Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to display the latest value from a field in a KPI.
vMaxDate is declared as a variable and has the latest date from the table of information.
'Date' and 'SampleField' are both fields within my data set.
I'm trying to use the following expression within my KPI and it doesn't work.
MAX({1<Date={vMaxDate}>} SampleField)
It won't display anything. I tried copying and pasting the exact same expression into a table for debugging purposes but I receive an 'invalid dimension' error.
I wouldn't mind understanding how to display the latest value (based on date) on app startup and then the KPI displayed value being overwritten once a selection is made. I'm not sure how to approach that.
Thanks.
Thanks very much. It worked. I'll need to do more reading into the differences around using single quotes versus double quotes as well general expression syntax. In addition, I tried using another basic aggregation function like Max() because I thought it should work as well. It did. I guess in this instance, because of the filters that are applied, it doesn't really matter which aggregation function you use.
Glad it worked. Yes, if the Set filters down to one value of SampleField, any aggregation function -- Max, Avg, Sum, Only -- will return the same results. Technically, if you are expecting only one value and want to consider mutiple values as an error, Only() is the safest as it will return null if there is more than one value.
-Rob