Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
renatocouto
Contributor
Contributor

If condition with two ValueList variables

Hello everyone,

I have two variables that are two different synthetic dimensions with the ValueList expression. For example:

V_AB = ValueList('A','B')

V_CD = ValueList('C','D')

I want to create dimension which shows V_AB or V_CD depending if there is a selection in my dimension X. I have tried the following:

Condition = If(IsNull(GetFieldSelections(X)), $(V_AB),$(V_CD))

However, this condition returns my dimension X instead of V_AB or V_CD. When I try to show V_AB and V_CD individually it works just fine, but with the condition it does not work. 

Any idea what I'm doing wrong here? Thank you in advance.

 

 

Labels (1)
1 Reply
eliran
Creator III
Creator III

Hi,

 

I would just wrap the dimension with if statement.

So you got two dimensions using the variables, and on each one you have an if statement.

Not the most elegant way, but I'm not sure there is a way to acheive what you want using if inside the dimension.

You can use it outside as a 3rd variable, and use this one as a dimension.

 

I hope it helps,

Eliran.