Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rougeherring
Contributor III
Contributor III

List values of field A based selection of field A based on field B, indirect filter?

Qlik Sense Question

I've created an example for clarity:

I want to see in the visualization all of the fruit that are available from states that offer that fruit.

  

IDFruitOrigin State
1AppleNew Jersey
2ApplePennsylvania
3AppleNew York
4AppleCalifornia
5AppleOregon
6PearNew Jersey
7PearPennsylvania
8PearCalifornia
9PearNew Mexico
10PineappleFlorida
11PineappleTexas
12PineappleGeorgia
13PineappleSouth Carolina
14Pineapple

New Mexico


So if I select Apple, the result should be all of the fruit offered by New Jersey, Pennsylvania, New York, California, and Oregon

  • Apple
  • Pear
1 Solution

Accepted Solutions
sunny_talwar

‌So I guess the bottom line is that to get those Fruits which are sold in the city of your selected fruit you will need to use this as your set analysis -> {<[Origin State] = p([Origin State]), Fruit>}

IT can be used in text box object like I pointed out or in straight or pivot table as needed.

I hope our suggestion will be useful for you.

Best,

Sunny

View solution in original post

6 Replies
sunny_talwar

Try this expression:

=Concat(DISTINCT {<[Origin State] = p([Origin State]), Fruit>}Fruit, ', ')

in a text box object.

maxgro
MVP
MVP

maybe a chart with 3 dims and 1 exp

=Only( {$ <[OriginState]=p([OriginState]), Fruit=>} Fruit)

1.png

sunny_talwar

‌So I guess the bottom line is that to get those Fruits which are sold in the city of your selected fruit you will need to use this as your set analysis -> {<[Origin State] = p([Origin State]), Fruit>}

IT can be used in text box object like I pointed out or in straight or pivot table as needed.

I hope our suggestion will be useful for you.

Best,

Sunny

rougeherring
Contributor III
Contributor III
Author

The expression does show me a list of all of the items I am looking for.

Could you show me the expression needed to show the information in a bar chart to show the count of each of the fruit?

Example: Bar should show 5 apples, 3 pears

sunny_talwar

Expression:

=Count({<[Origin State] = p([Origin State]), Fruit>}Fruit)


Capture.PNG

rougeherring
Contributor III
Contributor III
Author

Thank you, works perfectly.