Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum if max problem

Hello all,

I would like to have the sum of the last day sales only, but I have a aggr error.

I have the folowing formula for the last day value:

if(max(total Date) = max(Date) and count(distinct Date)=1, [Sales(K$)],0)


with the following result:


DateProductSalesLast day sales
25/5/2017Apple25k$0$
25/5/2017Bananas30k$0$
28/5/2017Oranges65k$65k$
28/5/2017Apple21k$21k$


The result expected is merely the sum of the last day sales, but it doesn't work:


sum(if(max(total Date) = max(Date) and count(distinct Date)=1, [Sales(K$)],0))

error: Nested aggregation not allowed

Could you please help?

Thanks in advance,

Nicolas

1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum(Aggr(If(Date = Max(TOTAL <Product> Date), Sales), Product, Date))

View solution in original post

2 Replies
sunny_talwar

May be this

Sum(Aggr(If(Date = Max(TOTAL <Product> Date), Sales), Product, Date))

Not applicable
Author

it works, thanks a lot Sunny