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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of difference of dates

Hi everyone ,

Can you point out error in the below expression???

Sum(

(Date(sale_date,'MM/DD/YYYY')-Date(Min( Total<category> sale_date),'MM/DD/YYYY'))

)

Thanks.

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You're using min inside a sum without an aggr. If you nest aggregation functions you need to use the aggr function

Sum(

(Date(sale_date,'MM/DD/YYYY')-Date( aggr( Min( Total<category> sale_date), SomeDimensionHere ) ,'MM/DD/YYYY'))

)

Perhaps SomeDimensionHere is category in your case.


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

You are using an aggregation function (min() ) within another aggregation function (sum() ), which is not possible.

You probably need to apply advanced aggregation (i.e., the aggr() function).