Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

manisekhar1986
New Contributor II

Exclude Filter from Affecting Chart when filter dimension is an expression

Hi All,

In my date filter field, i am displaying only the latest closed month (Idea is to toggle between full year view and recent month view).

i am using an expression as follows:

=if(Month(Closeddate) = vMaxMonth and Year(Closeddate) = vMaxYear, vMaxMonth)

I have created variables vMaxMonth & vMaxYear in the load script to get the month and year of the maximum closed date.

Now, my requirement is that i dont want this filter to affect one chart alone. Hence i give the expression as:

Count ({<Closeddate =>} [Application ID])

But this does not work. If i had displayed all closed dates in the filter instead of the expression i have used, the above works.


Is this a property of Qlik or do i need to use a different expression in place of the above to ensure that the filter is not considered?

Yours Truly,

S.Manikantan

15 Replies
ChennaiahNallani
Contributor III

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

Try like below.

Count({<Closeddate >}GlobalEmpId)

manisekhar1986
New Contributor II

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

No Chennaiah..Not working. Shows 'Error in Expression'. Is Global a Qlik Sense keyword?

joseph_eftamand
Contributor

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

Are the filters you are actually making the selections on for Closeddate, or are they month, day etc?

If so you should try adding <Closeddate = , Month = , Day = > to your modifier.

manisekhar1986
New Contributor II

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

The field name is closed date, but the filter i am displaying is of the Month as below.

=if(Month(Closeddate) = vMaxMonth and Year(Closeddate) = vMaxYear, Month(Closeddate))

When i select the Month, all charts get filtered accordingly. I want to prevent the filtering in one chart alone now. I tried to create a field called 'ClosedMonth' in the table and tried it in place of above.

=if(Month(Closeddate) = vMaxMonth and Year(Closeddate) = vMaxYear, ClosedMonth))


But still no effect. When i use just  'ClosedMonth' in the filter instead of using the IF expression, it works fine i.e. i am able to prevent the chart from being filtered when month is changed.

ChennaiahNallani
Contributor III

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

share sample qvf.

joseph_eftamand
Contributor

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

based on this expression I would expect the filter to only show one month:

if(Month(Closeddate) = vMaxMonth and Year(Closeddate) = vMaxYear, Month(Closeddate)),


which is a bit confusing


If you can upload a sunset of the app I can try and test for you.


Thanks,


Joseph

manisekhar1986
New Contributor II

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

Hi Joseph. I may be able to provide the code only as i work on client network with limited access for sharing.

Yes, Thats Right. I want to show only one month in the filter.

After i load the table which contains Closeddate field, i run the below script:

Temp:

LOAD

     Max([Closeddate]) as Maxcd

Resident [TK_TRN_TicketDetail];

LET vMaxDate = Date((peek('Maxcd')));

LET vMaxYear = Year(vMaxDate);

LET vMaxMonth = Month(vMaxDate);

LET vMaxmy = vMaxMonth & '-' & vMaxYear;

I have created a few charts and my aim now is to toggle view between full data and data for the last closed month. I create a filter where i display the last closed month as below:

=if(Month(Closeddate) = vMaxMonth and Year(Closeddate) = vMaxYear, ClosedMonth))

In the chart where i display applications which i want to prevent getting filtered by date, i use the expression:

Count ({<ClosedMonth =>} [Application ID])

This is not helping i.e. still data gets filtered.

joseph_eftamand
Contributor

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

I will try replicate this on my own here. Just to double check in the meantime you are including all date fields used in you set analysis?

Count ({<ClosedMonth =, ClosedDate = >} [Application ID])

manisekhar1986
New Contributor II

Re: Exclude Filter from Affecting Chart when filter dimension is an expression

Thanks Joseph. Yes, using all date fields.

Community Browser