Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
awwitas
Contributor II
Contributor II

Make a selection in a different field when user makes selections?

Suppose I have the following simple table:

Load * inline [
ProductID, ProductNM
1, Apple
2, Pear
3, Tomato
4, Grape
];

 

Let's say there is another table loaded that has ProductID as a key and some data.

I then want to create a table like this:

awwitas_0-1719522279517.png


But I would like the behavior to be that when a value in the <ProductNM> column is clicked by the user, the <ProductID> is actually what gets the selection. For example, doing this:

awwitas_1-1719522388745.png

 

Should result in this:

awwitas_2-1719522411930.png

I know I can user Aggr() for this:

=Aggr( ProductNM , ProductID)

awwitas_3-1719522490387.png

However, doing that makes it difficult to select multiple values, because as soon as you click on one value the rest disappear from the selection box:

awwitas_4-1719522675321.png

 

I can get pretty close to the desired functionality by wrapping <ProductNM> with the Only() function and a set identifier:

=Aggr( Only({1} ProductNM), ProductID)

awwitas_5-1719522805578.png

 

However:

1) All other field value options show as 'excluded' (dark grey) instead of 'alternative' (light grey)

2) I am mildly concerned that with a big set of data and many additional fields there'll be a performance cost to using the Aggr()/Only() combo.

 

Is there any other way to accomplish this? Is the performance issue a concern?

 

In the use case I have in mind, there will always be a 1:1 relationship between <ProductNM> and <ProductID>. I'd like this functionality to avoid users possibly getting confused by having intersecting selections in both <ProductID> and <ProductNM> - the actual Qlik has many sheets and a significantly more complex data model, so I'd like to keep possible selections in key fields to a minimum.

 

 

Labels (1)
1 Reply
marcus_sommer

The native Qlik logic of associating data worked well and is very simple in the usability for the users - but very powerful. I have the impression that you want to simplify it even more with high risks to disimprove it.