Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

naveenchellaara
New 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?

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Multiple pick statements in Expressions

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

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

exp being your expressions.

7 Replies
Not applicable

Re: Multiple pick statements in Expressions

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
New Contributor III

Re: Multiple pick statements in Expressions

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

Not applicable

Re: Multiple pick statements in Expressions

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
New Contributor III

Re: Multiple pick statements in Expressions

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

MVP
MVP

Re: Multiple pick statements in Expressions

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

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

exp being your expressions.

joanna_c_bernar
New Contributor

Re: Multiple pick statements in Expressions

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

MVP
MVP

Re: Multiple pick statements in Expressions

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

Community Browser