Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression referring to current row value

Dear All,

please look at the attached example below,

I want to find the sales amount for every customers refer to their last Sales Date.

I use sum(if(Date = $(=max(Date)), Amount))

but only customer c with the Max Date of the entire Data set will return the correct result,

can anyone help?

Many thanks!!!

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The $() substitution id done only once for the entire chart. Instead, you need to use aggr() for row by row calculation,

sum(if(Date=aggr(NODISTINCT MAX(Date),Customer),Amount))

-Rob

Anonymous
Not applicable
Author

PFA