Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
WE ARE LISTENING! New Navigation for Qlik Community, Sept. 26: TELL ME MORE
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!