Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to insert filter last 2 yr into my expression ?

Hi All

I want to add filter for display Current year and Previous year only.

My expression (A)  is :-

money(

Sum(sales/$(Columndim89)/1000)

, $(vMoneyFormatK))

For filter last 2 year , the code is :-

Year={">$(=year(today())-2)

My Question is how to insert the above to Expression (A) ?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

money(

Sum(

{<Year={'>$(=year(today())-2)'}>}

sales/$(Columndim89)/1000)

, $(vMoneyFormatK))


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

money(

Sum(

{<Year={'>$(=year(today())-2)'}>}

sales/$(Columndim89)/1000)

, $(vMoneyFormatK))


talk is cheap, supply exceeds demand
Not applicable
Author

Hi All

Forget to explain my Objective. my chart now display many year sales line. i want to make it display current year and previous year.

Enclosed is my QV doc

alexandros17
Partner - Champion III
Partner - Champion III

You can do in this way

money(Sum(if(Year>=year(today())-2 ,sales,0)/$(Columndim89)/1000), $(vMoneyFormatK))

or in this way


money(Sum({$ <Year={'>$(=year(today())-2)'}> }sales)/$(Columndim89)/1000), $(vMoneyFormatK))

Hope it helps

MK_QSL
MVP
MVP

Change your Year Dimension to Calculated Dimension as below..

=IF(Year = Year(Today()) or Year = Year(Today())-1, Year)

Don't forget to tick Suppress When Value is NULL..

Hope this helps...