Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
dafnis14
Specialist
Specialist

Current Month Previous year

Hi,

I wonder why using the current month doesn't work for previous year:

sum({<Month={'$(vMaxMonth)'}, Year={'$(vPreviosYear)'}>} LineTotal)

Only a date range:

sum({<Date= {">=$(vMonthStartPrevYear) <=$(vMonthEndPrevYear)"}, Year=,Month=, Date=>} LineTotal)

Thanks!

1 Solution

Accepted Solutions
sunny_talwar

Huh!! even the hard coding gives the incorrect result? That is very strange.... also, I made a mistake in my previous expression... Year and Month should not repeat... can you try this and see if this works

Sum({<Month={'10'}, Year={'2017'}, Date>} LineTotal)

View solution in original post

4 Replies
sunny_talwar

May be you have to ignore selection in Year, Month and Date just like your other expression

Sum({<Month={'$(vMaxMonth)'}, Year={'$(vPreviosYear)'}, Year, Month, Date>} LineTotal)

dafnis14
Specialist
Specialist
Author

Hi Sunny,

It doesn't help..

even writing the expression as follows gives a wrong result:

sum({<Month={'10'}, Year={'2017'},Year=,Month=,Date=>} LineTotal)

I'm getting a much larger sum then expected, but can't figure what it is..:-(

Thanks!

sunny_talwar

Huh!! even the hard coding gives the incorrect result? That is very strange.... also, I made a mistake in my previous expression... Year and Month should not repeat... can you try this and see if this works

Sum({<Month={'10'}, Year={'2017'}, Date>} LineTotal)

dafnis14
Specialist
Specialist
Author

Great, Sonny!

"Year and Month should not repeat" - made my day!

Thank you!