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: 
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
Author

Hi,

Verify that variable reflecting 21 or not?

Please post sample data or app for the expected solution.

mangalsk
Creator III
Creator III

Hello,

Please send sample qvw

Not applicable
Author

Hi Håkan

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

Lukasz

tresesco
MVP
MVP

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.

its_anandrjs

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
Author

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

tresesco
MVP
MVP

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

Not applicable
Author

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
Author

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.