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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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!!!

Labels (1)
2 Replies
rwunderlich
MVP
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