Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
jeevays7
Partner - Creator III
Partner - Creator III

display common values of two selected field value

Hi All,

I have a table like Below.

ID     Name     Value

1          A              5

2          B             10

3          A               4

3          B               6

when i select two id's from the above table , that is 1, 3. The table should show the common Name of selected Id's.

Result Table(pivot table):

Name     ID Value

A          1     5

            3     4

How can i get ?? please suggest any idea??

1 Solution

Accepted Solutions
sunny_talwar

I guess what happens when you have selected 3 IDs in the above example? or will you always select 2? You can try this if you always plan to select 2 or if you select 3... you would want to see what is common between the 3

Dimension

Name

ID

Expression

=Sum({<Name = {"=Count(DISTINCT ID) = GetSelectedCount(ID)"}>} Value)


Capture.PNG

View solution in original post

15 Replies
Not applicable

Hi Swaran,

Please take pivot table with Dimensions: Name & ID and expression as sum(value). This will give you the above result

test4.PNG

I Hope this is your requirement.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You should create a pivot table.

Right click on sheet-> New Sheet Object -> Charts -> Select the pivot chart type.

Add Dimension as Name and ID and expression as Sum(Value)

Click ok and you will see the expected result.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jeevays7
Partner - Creator III
Partner - Creator III
Author

Hi Kaushik,

Thaks for your reply.

I asked how to show common names of selected id's. how can i get ??

sunny_talwar

I guess what happens when you have selected 3 IDs in the above example? or will you always select 2? You can try this if you always plan to select 2 or if you select 3... you would want to see what is common between the 3

Dimension

Name

ID

Expression

=Sum({<Name = {"=Count(DISTINCT ID) = GetSelectedCount(ID)"}>} Value)


Capture.PNG

jeevays7
Partner - Creator III
Partner - Creator III
Author

Thank you sunny,

Yes, i want 3 selection and so on... based on how much we have selected.

jeevays7
Partner - Creator III
Partner - Creator III
Author

if you select 3, common values of selected id's will come.

sunny_talwar

Then the above expression should work for you... have you tried it out?

jeevays7
Partner - Creator III
Partner - Creator III
Author

Thank you sunny.

It is working fine.

Then if i have Name "B" is in Id's 1 and 3.

so we get the output like below

Name   ID     Value

A           1       5

             3       4

B           1       2

             3       4

so i can i get sum of value based on ID from above table??

ID     Value

1          7

3          8

sunny_talwar

Remove Name as dimension and use just ID as dimension and the same expression

=Sum({<Name = {"=Count(DISTINCT ID) = GetSelectedCount(ID)"}>} Value)