Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nrq
Contributor III
Contributor III

Multiple sets in the same expression using set analysis?

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 want the sum of Sales to display data for CustomerType 1 only if they're in the United States or Canada as well as CustomerTypes 2 and 3 only if they're in the United States, Mexico, or India. I can't use one single set for this requirement because, for example, it would include India data for CustomerType 1 which I do not want.

Is what I'm trying to do possible? How do I format the code?

Labels (2)
1 Reply
Lisa_P
Employee
Employee

Try this:

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