Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to write an expression with set analysis that will sum the number of Sales (IsSale) if the Sale age is between 0 and 30
Here is what I have so far but it isn't working out
Sum({$<SaleAge={>=(0)<=(30)>} IsSale)
What am I doing wrong, what is the correct syntax?
Thanks for the help.
Sum({$<SaleAge={">=0<=30"}>} IsSale)
Hi Brian,
Try this logic,
sum({<SalesAge = {">=0"}, SalesAge = {"<=30"}>}Sales)
this will help you and also find attached application.
-- Regards,
Vishal Waghole
I know this post is several years old now, but I'll add to Massimo's solution (thank you by the way)...
Depending on your application and what it may be used for, using a variable for this would make the formula more dynamic. Note that the extra '=' sign and the '+0' isn't necessary. But I like to setup the expression like this because it makes shifting the value easy. I use this method to do a rolling 12 months calculation.
Sum({$<SaleAge={">=0<=30"}>} IsSale) //Static
Sum({$<SaleAge={">=$(=vMinAge-0)<=$(=vMaxAge-0)"}>} IsSale) //Dynamic
I use this method to do a rolling 12 months calculation.
Sum({$<SaleAge={">$(=vCurrentMonth-12)<=$(=vCurrentMonth-0)"}>} IsSale)
Hope this is useful to somebody out there! 🙂
Emile
Thanks for expanding this one - really useful 🙂