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: 
Anonymous
Not applicable

pick function

Hi,

I'd like to set a function to select the right colour for a chart.

The simlest way to do it is as follows:

pick(match(brand,'A','B','C'),colour1,colour2,colour3)


But the point is that I have 100 brands and 100 user-defined colours. The colour values are set in a field in a table. Keeping the colours in a table is more convenient than keeping them as separate variables.

So, there is a field [Colour] with 100 values.


Is it possible to use a reference to the field [Colour] instead of the list 'colour1,colour2,colour3,... colour100' in a pick function?


If not, then what other function can I use to select colours that are kept as field values?


Thank you in advance,


Larisa

10 Replies
Anonymous
Not applicable
Author

Hi, Tresesco, Narven Raja,

The Concat function works only if I set it like this:

vColor=Concat( Distinct ColorField, ',')

pick(match(brand,'A','B','C'), $(=$(vColor)))


Thanks for your help!


Larisa