Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
mahitham
Contributor

If logic help in filter pane

Hi Experts,

Can any one please help me on below requirement.

In the below Month Year fitlerpane , could you please help me to show only Current year 2019 and Previous Year 2018 Related month Year values by take our 2017 Month year values  in UI

MonthYear.png.

4 Replies
pradosh_thakur
Honored Contributor II

Re: If logic help in filter pane

If(Year(MonthYear)= 2018 or Year(MonthYear)= 2019, MonthYear,null()) 

then supress null

 

If you are looking for this year and last year data use year(today()) and year(today())-1 instead of hard coding 2018 and 2019

Learning never stops.
VishalWaghole
Valued Contributor II

Re: If logic help in filter pane

Try this,

If(wildmatch(MonthYear,'*2018','*2019'),MonthYear)

Regards,
Vishal Waghole
mahitham
Contributor

Re: If logic help in filter pane

Hi @pradosh_thakur 

Thanks for your help.

I am looking dynamic solution. I need to use max(Year) and Max(Year)-1 all month years.

I struck at if logic syntax.

Please help me on this.

 

Highlighted
VishalWaghole
Valued Contributor II

Re: If logic help in filter pane

First of all create Year field from your MonthYear field.
Then use below steps to dynamically take only latest two years from your year field.

Create two variable using below definition.

vMaxYear = max(Year)
vMaxYear1=max(Year,1)

Create list box using below expression.

=Aggr(Concat({<YEAR={'$(vMaxYear)','$(vMaxYear1)'}>} Distinct Year), Year)

Hope this will work for you.

Thanks,
Vishal Waghole