Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rougeherring
New Contributor

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
MVP
MVP

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

‌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

6 Replies
MVP
MVP

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

Try this expression:

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

in a text box object.

MVP
MVP

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

maybe a chart with 3 dims and 1 exp

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

1.png

MVP
MVP

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

‌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
New Contributor

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

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

MVP
MVP

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

Expression:

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


Capture.PNG

rougeherring
New Contributor

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

Thank you, works perfectly.