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: 
Vince_CH
Creator III
Creator III

Differentiation between fields values combined with letter and numbers

Hello friends, 

I have a list of field values like below,  I want to differentiate the yellow values from the grey ones, how shall the scripts or expressions should like? thanks in advance for the help. 

11.jpg

1 Solution

Accepted Solutions
Ivan_Bozov
Luminary
Luminary

Great, then maybe try this:

IF(MATCH(LEFT(YourField, 2), 'R8') OR MATCH(LEFT(YourField, 3), 'R14', 'R15'), 'Yellow', 'Gray') AS YourNewField
vizmind.eu

View solution in original post

3 Replies
Ivan_Bozov
Luminary
Luminary

I suppose this is not your full list, so what exactly differentiates these values? Do they always begin with R1 or R8? Is the length always 7 or 10 characters? Is it something else?

vizmind.eu
Vince_CH
Creator III
Creator III
Author

Hello Ivan, you gave me some hints here.

yes the yellow marked field value always starts with R8, or R14 or R15, so can i write like this in the scripts?

If (left(filedvalue,2)='R8' or left(filedvalue,3)={'R14' ,'R15'}, filedvalue) as YELLOW,

Best regards!

Vincent

Ivan_Bozov
Luminary
Luminary

Great, then maybe try this:

IF(MATCH(LEFT(YourField, 2), 'R8') OR MATCH(LEFT(YourField, 3), 'R14', 'R15'), 'Yellow', 'Gray') AS YourNewField
vizmind.eu