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

Building Variable Identifier using Field

Hi,

i have  variables: vCustomColor1,vCustomColor2,vCustomColor3... and a Field SampleRank()1,2,3...

I want to create a build a variable dynamically: =$(='vCustomColor'&SampleRank)

This works if I select 1 Sample, however It does not work when I use SampleRank as dimension of a table, where each column provides a different Rank (1,2,3...)

What am I missing?

Best Regards

5 Replies
ahmar811
Creator III
Creator III

Can you please explain with example what you actually want with sample qlikview file or screenshot.

Regards

Ahmar

marcus_sommer

You are creating with =$(='vCustomColor'&SampleRank) a new adhoc-variable which could only have one value at the same time. This meant it couldn't be used to evaluate anything on a row-level else it will be caluclated once before the chart is calculated an applied to each row.

As alternatively you could use an expression like this:

pick(match(SimpleRank, 1,2,3, ...),

     vCustomColor1,vCustomColor2,vCustomColor3, ...)

A further approach might be this here: Colors in charts

- Marcus

MK_QSL
MVP
MVP

Try to create colour at back end..

Colors in charts

chrweber
Creator
Creator
Author

Coloring is not my problem.  Dynamically specifying a variable, however, is.

chrweber
Creator
Creator
Author

Thank you for your suggestion.

My hack works only under the restriction that there are only a limited number of rows, which I enforce.

your suggestion appears to make that restriction explicit. I will try it.