Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

arusanah
Contributor

Help With QSVariable

I am using QsVariable to switch between expressions  for my SimpleKPI Object.

for Dimension I am using Following Expression .

if(Metric1=2,PlanA,Aggr(Only({<[PlanB] -= {'New*'}>} [PlanB]), [PlanB]))

But what is happening is it only picks first Dimension i.e PlanA,it doesn't go to else part... I'm not able to replicate the issue .

can anybody help

5 Replies

Re: Help With QSVariable

You mean that when Metric1 is not equal to 2 it doesn't show PlanB as dimension?

arusanah
Contributor

Re: Help With QSVariable

right

TKendrick20
Valued Contributor

Re: Help With QSVariable

The IF statement looks fine, you may have to use $(Metric1).

Re: Help With QSVariable

Can you try this:

If(Metric1 = 2, PlanA,

     If(Not WildMatch(PlanB, 'New*'), PlanB))

shraddha_g
Honored Contributor III

Re: Help With QSVariable

you can use following,

pick( wildmatch( vVariable ,'Value1','Value2'),

Expression1,

Expression2

)

for Dimension:

pick( wildmatch( vVariable ,'Value1','Value2'),

Dimension1,

Dimension2

)

Here, vVariable is variable used in QSVariable and It has values as Value1, Value2

It will return Expression1 if vVariable = Value1, else Expression2. it will works same as expression for dimensions.

Regards,

Shraddha