Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

KPI - Displaying a single static value based on a date

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.

11 Replies
Anonymous
Not applicable
Author

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.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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