@MattWindsor ok I think I understand a bit better what you are asking.
This line:
“But as it’s a collection, I think it has to output all results as that’s what it’s designed to do.”
Slightly not correct. The collection means it has to iterate (LOOK through all results), not that it has to OUTPUT all results. A common IF/THEN statement is “If it fulfills something, then output the result[, otherwise do nothing]” -- this is why the syntax stated in the adobe documentation is “IF(condition, trueExpression, falseExpression)”
This line:
“Would adding similar expression logic to the report filter reduce what the collection returned?”
No. Ultimately your project filter is designed to filter projects in or out. In a case where you have 4 docs, only ONE of which matches your criteria and the other 3 do not, the project would be filtered either in OR out based on what you chose to filter on. (“quote” in the filename would translate into “if a project has ANY file with “quote” in the name, leave it out” -- so even if it has another legitimate file, it would stay out)
Taking the valueexpression that we all have been focussing on:
IF(!ISBLANK({currentVersion}.{proofID})&&!CONTAINS("Quote",{name}),CONCAT({name}," - ",IF({project}.{DE:C+D Creative Deadline}>={entryDate},"Yes","No")),CONCAT({name}," - n/a"))
This is two merged IF statements. I tried to do a color formatting to help you see them, so hopefully the below works. Black is 1 IF statement, and bolded red is the other one.
IF(!ISBLANK({currentVersion}.{proofID})&&!CONTAINS("Quote",{name}),CONCAT({name}," - ",IF({project}.{DE:C+D Creative Deadline}>={entryDate},"Yes","No")),CONCAT({name}," - n/a"))
Taking the “IF(condition, trueExpression, falseExpression)” syntax again to break down your statement:
first condition: if there is a proof ID and the name doesn’t contain quote;
first true expression: display the name (you can see this is where we are already in trouble -- we just told it to display the name no matter what else happens) and then do the second IF statement
first false expression: otherwise just display the name and then “n/a”
second condition: if the creative deadline is greater than the entry date;
second true expression: then add a “yes”
second false expression: otherwise add a no.
Normally an IF statement is set up so it’s EASIER to exclude results (spoiler alert, yours is not and we’ll have to rebuild it). As an example, this one change would exclude anything that doesn’t have a proof generated.
IF(!ISBLANK({currentVersion}.{proofID})&&!CONTAINS("Quote",{name}),CONCAT({name}," - ",IF({project}.{DE:C+D Creative Deadline}>={entryDate},"Yes","No")),””)
As you can see, the “” thing I did at the end just excludes anything that didn’t fulfill your first condition. So now anything that isn’t a proof or has “Quote” in the name would get dropped.
I highly recommend you try this intermediate step just so you can see it at work, rather than scrolling down to try and find the answer to copy and paste.
I’m actually not going to parse the answer through AI -- I’m just going to guess it. The logic re-wording of your statement should be:
first condition: if there is a proof ID and the name doesn’t contain quote (didn’t change);
first true expression: do the second IF statement
first false expression: otherwise just display the name and then “n/a” (changed this to the “” and explained why above)
second condition: if the creative deadline is greater than the entry date; (no change here)
second true expression: display the name
second false expression: otherwise do that “” thing again.
Do you want to take over from here and see if you can restructure the valueexpression I originally gave in order to get your desired result?