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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated colors in caption

Can anyone help me out because i have this field that has three values and i want all caption to change colors for each value that they pick in the field but i cant seem to find the right formula because the normal if is only good for 2 colors like

if(GetFieldSelections([Field]) = 'A',RGB(0,0,0),RGB(255,255,255))

how can i make a three color if statement?

Help would much be apreciated. ;)c

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

As far as my understanding of your problem. You can write in this way

if(ID=1,rgb(55,255,255),
if(ID=2,rgb(255,25,205),
if(ID=3,rgb(2,55,255))))



View solution in original post

3 Replies
Not applicable
Author

As far as my understanding of your problem. You can write in this way

if(ID=1,rgb(55,255,255),
if(ID=2,rgb(255,25,205),
if(ID=3,rgb(2,55,255))))



brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

do you want to find a substring, so could help that function:

index( s1 , s2 [ , n ] )

Position of a substring. This function gives the starting position of the n:th occurrence of substring s2 in string s1. If n is omitted, the first occurrence is assumed. If n is negative, the search is made starting from the end of string s1. The result is an integer. The positions in the string are numbered from 1 and up.

Examples:

index( 'abcdefg', 'cd' ) returns 3

index( 'abcdabcd', 'b', 2 ) returns 6

index( 'abcdabcd', 'b', -2 ) returns 2

left( Date, index( Date,'-') -1 ) where Date = 1997-07-14 returns 1997

mid( Date, index( Date, '-', 2 ) -2, 2 ) where Date = 1997-07-14 returns 07

Hope, that's it!

Not applicable
Author

Thats it..thanks so much!