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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sumif

Hello,

I have a straight table with one dimension, “ITEM”. “Date”, “PO Rec Date”, “Net Units”, and “PO Rec Date” are field names. For every item, I need to sum all “Net Units” sales that occurred after the Max of the “PO Rec Date” field, of this particular item. Namely, every sale with a “Date” value above the Max of  “PO Rec Date”. Every item (dimension value) has a different Max of “PO Rec Date”.

That is why the following expression doesn't work (because it takes the absolute max of “PO Rec Date”😞

sum({$<Date={">=$(=max([PO Rec Date]))"}>}[ Net Units])

But for some reason this expression doesn't work either:

sum(if(Date>=max([PO Rec Date]),[Net Units],0))

Any ideas?
Thanks

1 Reply
swuehl
MVP
MVP

You probably need advanced aggregation, something like

=sum(aggr(if(Date>=max(total<ITEM> [PO Rec Date]),[Net Units],0), ITEM, Date))