Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
naveenchellaara
Contributor III
Contributor III

Multiple pick statements in Expressions

Is it possible to give multiple pick statements in an expression?

I need to achieve the folowing

pick(match(Var1,255,100,150,170,200),$(ColourCode1),$(ColourCode2),$(ColourCode3),$(ColourCode4),$(ColourCode5))

pick(match(Var2,255,100,150,170,200),$(ColourCode1),$(ColourCode2),$(ColourCode3),$(ColourCode4),$(ColourCode5))

pick(match(Var3,255,100,150,170,200),$(ColourCode1),$(ColourCode2),$(ColourCode3),$(ColourCode4),$(ColourCode5))

pick(match(Var4,255,100,150,170,200),$(ColourCode1),$(ColourCode2),$(ColourCode3),$(ColourCode4),$(ColourCode5))

pick(match(Var5,255,100,150,170,200),$(ColourCode1),$(ColourCode2),$(ColourCode3),$(ColourCode4),$(ColourCode5))

Can some one help me with this?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Have you tried the alt() function to do this?

=alt(exp1,exp2,exp3,exp4,exp5)

exp being your expressions.

View solution in original post

7 Replies
Not applicable

What is the objective for your expression?  You list several expressions that are valid, but what is it you want to accomplish or return from your expression?

naveenchellaara
Contributor III
Contributor III
Author

I need to achieve all these in a single expression... all statements are valid..

Not applicable

You offer 5 different expressions, each taking a different variable, each returning a color code based on that variable.  I don't follow how you want to combine these into a single expression.  What would the expression return?

Are you saying you want to evaluate the first pick, return a color code if Var1 matches one of the values supplied, otherwise evaluate the next pick, and so on?

naveenchellaara
Contributor III
Contributor III
Author

Yes. That exactly what i am trying to get to.

swuehl
MVP
MVP

Have you tried the alt() function to do this?

=alt(exp1,exp2,exp3,exp4,exp5)

exp being your expressions.

Anonymous
Not applicable

Hi im trying to have 2 dimensions on  the alt () using pick match expression as well to go along with the colour code. Is there any way to input this codes ?

eg:

alt(pick(match(StatusDescription,'good','bad','neutral'),red(),lightblue(),LightGreen()),

pick(match(Food,'Chicken rice','Fried rice','Muffins'),lightred(),blue(),LightGreen()))

Than You

Joanna Christine

swuehl
MVP
MVP

Could you upload a small sample QVW with some sample records and your current UI object?