Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am trying to use result of one of my expression in an aggregate function. But it says "bad field name". I know we cannot use them inside aggregate function. Is there any alternative to do this? Below is an Example.
Exp1: date(salesdate) - Label- Startdate
Exp2: Sum(if(salesdate>=Startdate and salesdate<=addmonths(Startdate,6),SalesQuantity,0))
In this specific case, date(salesdate) is just formatting the salesdate value to a date format.
In Exp2, you don't need a formatted date to make your numeric comparisons, so you could just write
=Sum(If(salesdate >= salesdate and salesdate <= addmonths(salesdate,6), SalesQuantity,0))
But the date comparisions are always true, right?
So I guess that's not what you want (but it has nothing to do with expression referencing then, too).