Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Creator III
Creator III

Try like below.

Count({<Closeddate >}GlobalEmpId)

Anonymous
Not applicable
Author

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

joseph_eftamand
Partner - Creator
Partner - Creator

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.

Anonymous
Not applicable
Author

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
Creator III
Creator III

share sample qvf.

joseph_eftamand
Partner - Creator
Partner - Creator

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

Anonymous
Not applicable
Author

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
Partner - Creator
Partner - Creator

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])

Anonymous
Not applicable
Author

Thanks Joseph. Yes, using all date fields.