Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dolly123
Creator II
Creator II

expression colours

color by expression 

SOUTH - RED

NORTH - GREEN

EAST - BLUE

WEST - YELLOW

I want to write the expression for colours 

any one can help me ?

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like below

Pick(match(urfieldname, 'SOUTH', 'NORTH', 'EAST', 'WEST'), Red(), Green(), blue(), Yellow())

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

6 Replies
MayilVahanan

Hi

Try like below

Pick(match(urfieldname, 'SOUTH', 'NORTH', 'EAST', 'WEST'), Red(), Green(), blue(), Yellow())

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Dolly123
Creator II
Creator II
Author

i have some extra NA and or more than than how to add in this expression

MayilVahanan

Try like below

Pick(match(urfieldname, 'SOUTH', 'NORTH', 'EAST', 'WEST')+1, LightGray(), Red(), Green(), blue(), Yellow())

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Dolly123
Creator II
Creator II
Author

3 or 4 extra NA,MA,TR etc 

if extra things in data how to changes in expression like this

Pick(match(urfieldname, 'SOUTH', 'NORTH', 'EAST', 'WEST')+3,pink(),black(), LightGray(), Red(), Green(), blue(), Yellow())

Dolly123
Creator II
Creator II
Author

If there is not name of region then how to apply colours if no name

MayilVahanan

Hi

Try like below

Pick(match(Coalesce(urfieldname, 'NA'), 'NA', 'MA', 'TR', 'SOUTH', 'NORTH', 'EAST', 'WEST'),pink(),black(), LightGray(), Red(), Green(), blue(), Yellow())

 

Coalesce() - return non-null values

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.