The reason why you code below doesn't work, because in your screen shot, you put month in your column, which means, in this portion, the order date is not unique.
IF ATTR([Order Date]) < ATTR([Reference Date]) THEN "Before"
If you look at the description of ATTR(), it should be a single value. In this case, your code should work if you change your month to date
Here is my result after changing month to day
Hope this could help you have a better understand.
Please let me know if you have question.
1 of 1 people found this helpful
If the [Reference Date] is a parameter, i think the error might just be related to the fact that you cannot leverage an ATTR() agg on parameters. There's no formal definition on why this is, but I suspect it has to do with the fact that parameters are not really non-aggregates or aggregates; you can actually compare a parameter to either type in a calculation and it seems to work fine. You might give this a go:
IF ATTR([Order Date]) < [Reference Date] THEN "Before"
It shouldn't give you a "Cannot mix Aggregate and Non Aggregate" error.
Indeed it helped! Thanks I've never have gotten through the real meaning of Attribute... But you just explained to me now