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: 
nrq
Contributor III
Contributor III

Can't filter on specified set analysis values

I have a pretty simple sum expression that uses set analysis:

sum({<[CustomerType]={"1","2","3"}>} [Sales])

This expression is working perfectly for me when I do not have any filters selected. HOWEVER, I still want to filter specifically on the individual CustomerTypes of 1, 2, and 3. When I select just one of them (e.g. CustomerType = "1"), the value doesn't change. The value showing is still the sum of all three CustomerTypes instead of just the one I have my filter set on.

How do I solve this problem or is it not possible?

Labels (2)
1 Solution

Accepted Solutions
MatheusC
Specialist II
Specialist II

 Hi, @nrq 

try like this 

sum({<[CustomerType]*={"1","2","3"}>} [Sales])

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

3 Replies
MatheusC
Specialist II
Specialist II

 Hi, @nrq 

try like this 

sum({<[CustomerType]*={"1","2","3"}>} [Sales])

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
nrq
Contributor III
Contributor III
Author

Thanks, that works. One other thing to complicate this further: Can I put multiple sets in the same expression? This is my current code which isn't working properly but showcases what I'm trying to do:

sum({<[CustomerType]*={"1"},[Location]*={"United States","Canada"}>} {<[CustomerType]*={"2","3"},[Location]*={"United States","Mexico","India"}>} [Sales])

In other words, I only want to include data for CustomerType 1 when the location is in the United States or Canada. But for CustomerTypes 2 and 3, I only want to include data when the location is in the United States, Mexico, or India. Is creating two sets like this in the same expression possible?

MatheusC
Specialist II
Specialist II

@nrq 

I don't know what your real requirement is, but imagining a scenario I would create a variable that would work alongside a button and alternate between [CustomerType]*={"1"} and [CustomerType]*={"2","3"} as well as [Location ].

If you are unable to go that way, I ask you to end the topic to close this first case, and open a new topic with this question so that others can help you with your requirement. If I also have any other ideas, I will help in this new thread.

Thanks!

 

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!