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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

sum if set analysis

hi there,

I want to write;

sum (sales)

filter1 : addmonths -2 (2 months before today)

filter2 : country=germany

can you help me write tihs with set analysis?

thanks.

Labels (1)
6 Replies
Anil_Babu_Samineni
MVP
MVP

Perhaps this?

Sum({<DateField = {">=$(=AddMonths(Date(Today()), -2)) <=$(=Date(Today()-1))"}, country = {'germany'}>}sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar
MVP
MVP

May be this

Sum({<country = {'germany'}, Date = {"$(=Date(AddMonths(Today(), -2)))"}>}sales)

Anonymous
Not applicable
Author

what is the $ for ?

sunny_talwar
MVP
MVP

Anonymous
Not applicable
Author

and my date filter is in 'YYYYMM'

so is it :

=Sum({<country = {'Germany'}, Date = {"$(=Date(AddMonths(Today(), -2),'YYYYMM'))"}>}sales)

(error)

MK9885
Master II
Master II

=Sum({<country = {'Germany'}, Num_Month = {$(=Max(Num_Month)-2)}>}sales)

This may work if you have months in numeric.

Like 1,2,3,4,....12