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

Additional filter on field already filtered using Set Analysis

sum({<Year={2010,2011}>}Amount)

Above is working fine. However, when the user Clicks on Year 2011, filter is not applied. I got around the problem by getting 2 fields, Year and YearRenamed in the load statement. I used Year in the set analysis and displayed YearRenamed for the user to further filter.

Is there a better solution? I would rather not have additional field YearRenamed to keep it clean.

Thanks,

Dinesh.

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Sorry, There was something wrong with quick reply:

Try:

sum({<Year*={2010,2011}>}Amount)

This will be the intersection between user selection and 2010, 2011

So, if user select 2010, he will get only 2010. If he selects 2009, gets 0

Hope the post works now...

View solution in original post

6 Replies
erichshiino
Partner - Master
Partner - Master

sum({}Amount)
Anonymous
Not applicable
Author

I cannot remove the set analysis as I need to avoid all the previous years prior to 2010 to begin with. At the same time, I need to give the user further ability to filter 2010 or 2011.

Regards,

Dinesh.

erichshiino
Partner - Master
Partner - Master

Sorry, There was something wrong with quick reply:

Try:

sum({<Year*={2010,2011}>}Amount)

This will be the intersection between user selection and 2010, 2011

So, if user select 2010, he will get only 2010. If he selects 2009, gets 0

Hope the post works now...

gandalfgray
Specialist II
Specialist II

Hi Dinesh

Try this:

sum({$*<Year={2010,2011}>} Amount)

Anonymous
Not applicable
Author

Thx Erick and Goran. Both your suggestion works, however I like Erick's option better as it is easier to read from a maintenance perspective. My only concern is that the editor shows as a red squiggly line giving a wrong impression that there is a syntax error.

Regards,

Dinesh.

erichshiino
Partner - Master
Partner - Master

in QV 10 I also got some "syntax errors" like this. I guess some structures are not recognized yet.

For example, noconcatenate is not recognized on the script.