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

Get related values base from selection

Hi Guys,

Hope someone can help me on this simple question

Below are the table with 2 dim and 1 exp.

Dim 2 List box created and user select B (Dim2) and expected result as per 2nd table

Dim 1Dim 2Qty
1000A1
1000B7
1000C2
2000D3
2000E4
2000F2
3000G5
3000B2
3000H5

Expected result

Dim 1Dim 2Qty
1000A1
1000B7
1000C2
3000G5
3000B2
3000H5

Any advise appreciated !!!

1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum({<Dim2, Dim1 = P(Dim1)>}Qty)

View solution in original post

3 Replies
sunny_talwar

May be this

Sum({<Dim2, Dim1 = P(Dim1)>}Qty)

Colin-Albert

In Qlik, if you select Dim2 as B, then the data is filtered to exclude all other data where Dim2 is not B.

So the output for the 2nd table will just be the 2 rows where Dim2 = B.

This is how selections work by default in Qlik, and not the way your user expected

Is your user wanting to select using Dim1 instead? Selection  1000 and 3000?

You can use Ctrl-Click to select multiple values in a listbox.

Otherwise as Sunny  stalwar1‌ suggested you can use a set expression that sums the data for the selected value in Dim2 and also includes the possible values for Dim1  Dim1 = P(Dim1),

Though this makes your chart expressions more complex and does not follow the standard selection logic in QlikView.

israq
Contributor II
Contributor II
Author

Hi Guys,

Worked like a charm!!!