Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Calculated dimension if-sentence


Hello,

I have two Groups DBoardL and DboardG that include different fields.

Depending on the value of variable vP1 would I use one of the Groups,

but it doesn´t work. What do I do wrong?

if(vP1='21',DBoardL,DBoardG)

kindly

Håkan

11 Replies
Not applicable

Re: Calculated dimension if-sentence

Hi,

Verify that variable reflecting 21 or not?

Please post sample data or app for the expected solution.

mangalsk
Contributor III

Re: Calculated dimension if-sentence

Hello,

Please send sample qvw

Not applicable

Re: Calculated dimension if-sentence

Hi Håkan

What do you mean by "doesn't work"? Is it always displaying DBoardG group as dimension?

Lukasz

MVP
MVP

Re: Calculated dimension if-sentence

It seems that group names can't be used in expression. Somebody correct me if I am wrong.

Update: I was trying with an alternative logic using 'Enable Conditional' taking two groups separately as dimension. Even that is not working.

Re: Calculated dimension if-sentence

No script is not correct you have to check the variable with field like check 21 with a field

let vP1 = 21;

if(Yourfield = $(vP1),DBoardL,DBoardG)



Hope this helps

Not applicable

Re: Re: Calculated dimension if-sentence

This was my first thought, but groups seem to 'almost' work in the expression (see attached)

MVP
MVP

Re: Calculated dimension if-sentence

If you notice carefully, the condition is not actually working on Groups but on fields.

Not applicable

Re: Calculated dimension if-sentence

Hello,

What i suggest is you pull both the groups into dimension list and you can have the enable condition on both the groups like below.

if(vP1='21',1,0) for first Group and if(vP1<>'21',1,0) for second group.

Hope it helps.

Thanks & Regards,

Venkat T

Not applicable

Re: Calculated dimension if-sentence

Hello again,

the if sentence works, but the Groups are treated as a single Field. Only the first field

is used, no drill down is possible., as a stright table it works. I maybee have to create

two different charts and show them depending on the value of vP1.

Community Browser