Skip to main content
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

1 Solution

Accepted Solutions
sunny_talwar

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

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))