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