Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
i need set expression
sum (sales)
filter1 : addmonths -2 (2 months before today)
filter2 : country=USA
how to use set expression?
thnks
bhagi
@bhagi like ?
=Sum({<date={">=$(=addmonths(today(),-2))"},country={'USA'}>} Sales)
@bhagi if you have doubts about date format you can use this version with your default date format
Sum({<date={">=$(=Date(addmonths(today(),-2),'DD/MM/YYYY'))"},country={'USA'}>} Sales)
Hi you can try this.
=Sum({<country = {'USA'}, Num_Month = {$(=Max(Num_Month)-2)}>}sales)
convert your month in number format foe better results.
or try this
Sum({<DateField = {">=$(=AddMonths(Date(Today()), -2)) <=$(=Date(Today()-1))"}, country = {'USA'}>}sales)
@bhagi you have received multiple responses to your use case, we would greatly appreciate if you would return to the thread and close it out by using the Accept as Solution button on the post(s) that helped you get a working solution. If you did something different, you may post that and then use the button to mark that post.
Here are some Design Blog post links that may be helpful as well:
https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344
https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822
Regards,
Brett