Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 mikhail_sirik
		
			mikhail_sirik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.

I tried the expression sum({<D1={">$(=Date(max(D2)))"}>} S) but this is not correct
 sunny_talwar
		
			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))
 YoussefBelloum
		
			YoussefBelloum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		EDITED:
Hi,
try this:
Sum({<D2={"$(=Max(Date(D2)))"}>}Aggr(Sum({<D2={"$(=Max(Date(D2)))"}>}S),P))
 sunny_talwar
		
			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))
