Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
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:
Should result in this:
I know I can user Aggr() for this:
=Aggr( ProductNM , ProductID)
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:
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)
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.
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.