Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bartwelvaarts
Contributor III
Contributor III

working with variables in set analysis

Hello friends of the Qlik community,

I want to calculate the sum of all the months before the month i a filter i created. I tried:

sum(YearMonth = {"<$(=vYearMonth)">} amount)

if i select year 2020 and month 5 in the filter i created, i will get all the results of the months under 05-2020 --> correct

now i want the results of the months before the month i selected but not lower then these months minus 3

So if i select month 05 -2020, i want only the months 4,3,2 of 2020

I tried sum( YearMonth = {"<$(=vYearMonth)"},JaarMaand = {">$(=vYearMonth-3)"}>} --> incorrect

vYearMonth = min(YearMonth) , which i created in the script. format is 202005

Can somebody help me where i go wrong?

Labels (1)
1 Reply
goncalo_ricardo_pereira
Partner - Contributor III
Partner - Contributor III

Perhaps you looking for something like this

 sum( YearMonth = {">$(=vYearMonth-3) <$(=vYearMonth)"}>}