Qlik Community

Qlik Sense Cloud Discussions

sashankmishraa
New Contributor

Select value of one field based on another selection

Hello Everyone,

I have a requirement, where I have to select value of one field based on another selected value.

For Example: I have a table in the visualization.

Item IDItem Quantity
140
250
350

If I select Item Quantity 50 in second row, both Item Quantity 50 will get selected but I want only the Item ID 2 to be selected.

I can understand why not to click on Item ID, but this scenario is part of a long requirement.

If some how my selection can reference the item ID while I select the value in Item Quantity the this is achievable.

Expecting some advice and help. Thanks.

Tags (2)
1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: Select value of one field based on another selection

May be you would try using Item Quantity dimension as below -

=Dual([Item Quantity],[Item ID])

6 Replies
MVP & Luminary
MVP & Luminary

Re: Select value of one field based on another selection

When clicking rows in a straight table, only Dimension values get selected.  So make [Item ID] the Dimension and =[Item Quantity] the Expression.  Clicking the [Item Quantity] cell should make a selection in [Item ID].

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

sashankmishraa
New Contributor

Re: Select value of one field based on another selection

Thank You for your quick response.

However, making Item Qty has expression does not allow me to make the selection on quantity in the straight table at all.

Digvijay_Singh
Honored Contributor III

Re: Select value of one field based on another selection

May be you would try using Item Quantity dimension as below -

=Dual([Item Quantity],[Item ID])

sashankmishraa
New Contributor

Re: Select value of one field based on another selection

This worked. Thanks a lot.

MVP & Luminary
MVP & Luminary

Re: Select value of one field based on another selection

Sorry, I missed that this was Qlik Sense.  Digvijay has a great answer that should work in both products.

-Rob

Barry_T
New Contributor II

Re: Select value of one field based on another selection

Hi Digvijay,

I am trying to use this in an expression but it does not appear to work, do you know the data type it  returns?

v.team =Dual([user_name],[team_id])

Avg({$<team_id={$(v.team)}>}score) 

If I display v.team in a KPI I get the results I expect (1 or 2 etc) but it doesn't seem to be able to pass that in an expression.

Any ideas? Or maybe I should be using something else for this?

 

Cheers,

Barry