Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

Add only one Filter in chart.

Hi All,

I am having one line chart and some other chart objects,

I have four filters. Now my requirement is, my Line chart get affected only Date filter and other filter won't make any changes in my chart. I can not use alternate state because Date filter associated with other chart object.

So please let me how to Set Analysis in this case.

Please help..

18 Replies
sushil353
Master II
Master II

hi,

you can easily do this using set analysis.

In your chart in expression try as below

Sum({<filter1=,filter2=, filter3=>} data)

just replace filter1,filter2.. 3 with your actual filter/fields

HTH

Sushil

soha1902
Creator
Creator
Author

Susheel thank you for your reply but I am using below if...else expreesion in my chart

if(date <= Date(Now()), Sum({<date={'>=$(vMinDate)<=$(=max(date))'}>}sales),
Sum({<date={'>=$(vMinDate)<=$(=max(date))'}>}sales))

Please suggest where I need to add filters now????

tresesco
MVP
MVP

And note that, you have to use the same set analysis in all the aggregation functions you have used(Sum, Max) in all your expressions.

ashfaq_haseeb
Champion III
Champion III

Had you look at the attached application

you can try below

if(date <= Date(Now()), Sum({<date={'>=$(vMinDate)<=$(=max(date))'},City=,Region=>}sales),
Sum({<date={'>=$(vMinDate)<=$(=max(date))'},City=,Region=>}sales))


Regards

ASHFAQ

soha1902
Creator
Creator
Author

My original expression is :

if(date <= Date(Now()), Sum({<date={'>=$(vMinDate)<=$(=max(date))'}>}sales),
Sum({<date={'>=$(vMinDate)<=$(=max(date))'}>}sales))

Please suggest Set analysis as per this expression.

Please help......

its_anandrjs
Champion III
Champion III

Filters are applied in the Aggregation functions like SUM, COUNT, MAX etc

Eg:=

if(date <= Date(Now()), Sum({<date={'>=$(vMinDate)<=$(=max(date))'},City=,Region= >}sales),
Sum({<date={'>=$(vMinDate)<=$(=max(date))'} ,City=,Region= >}sales))



soha1902
Creator
Creator
Author

I used this expression but still if I select others filters my chart get modified...

please help...

ashfaq_haseeb
Champion III
Champion III

I have Checked your application.

It is effecting due to date but not due to excluded filter.

Hope it helped.

Regards

ASHFAQ

tresesco
MVP
MVP

Soh, try this:

=if(date <= Date(Now()), Sum({<date={'>=$(vMinDate)<=$(=max({1}date))'},City=,Region= >}sales),

Sum({<date={'>=$(vMinDate)<=$(=max({1}date))'} ,City=,Region= >}sales))

And remember, if you are using max()/min() in variable declaration use similary {1} there as well.