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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
mikhail_sirik
Partner - Contributor
Partner - Contributor

Help make the expression

Dear, Experts

Help formulate an expression for the MagicExpression column.

The values should be equal to the sum of the values of the field S where D1 is greater than max(D2), for each P.

2018-04-20_141858.png

I tried the expression sum({<D1={">$(=Date(max(D2)))"}>} S) but this is not correct

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

I don't think this can be done using set analysis... try this

Sum(Aggr(If(D1 > Max(TOTAL <P> D2), Sum(S)), P, D1))

View solution in original post

2 Replies
YoussefBelloum
Champion
Champion

EDITED:

Hi,

try this:

Sum({<D2={"$(=Max(Date(D2)))"}>}Aggr(Sum({<D2={"$(=Max(Date(D2)))"}>}S),P))

sunny_talwar
MVP
MVP

I don't think this can be done using set analysis... try this

Sum(Aggr(If(D1 > Max(TOTAL <P> D2), Sum(S)), P, D1))