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: 
timothywhite1830
Contributor
Contributor

Using 'implied' filters in set analysis

I have a dataset that looks like this:

Fruit State Qty
Apple VA 50
Pear FL 25
Grape FL 15
Apple TX 40
Pear  TX 20
Grape FL 45

 

If I select 'Apple' as the fruit, I arrive at this selection set:

Fruit State Qty
Apple VA 50
Apple TX 40

 

I would like to conduct analysis on what I would call the 'implied' filter of states (being VA and TX) without having to explicitly select VA and TX.

Essentially, I would like to sum the values from this dataset:

Fruit State Qty
Apple VA 50
Apple TX 40
Pear  TX 20

 

Is there a way to use set analysis to pick up the fact that by selecting 'Apple', I now only have VA and TX in the dataset and then create a sum to include all fruit from those two states?

My thanks for your help.

Labels (2)
2 Solutions

Accepted Solutions
PrashantSangle

Use below 

Chart -- Table

Dim - State, Fruit

Expression - Sum(Qty)+Sum({<Fruit=,State=p(State)>}Qty)

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

Chanty4u
MVP
MVP

Try this 

SUM({< State = P(State) >} Qty)

 

View solution in original post

2 Replies
PrashantSangle

Use below 

Chart -- Table

Dim - State, Fruit

Expression - Sum(Qty)+Sum({<Fruit=,State=p(State)>}Qty)

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Chanty4u
MVP
MVP

Try this 

SUM({< State = P(State) >} Qty)