Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dimension groups in a calculated dimension

Hey

Is it possible to use dimension Groups in a calculated dimension?

I want to calculate a dimension where I use dimensiongroup1 if the variable var1 = 1 and dimensiongroup2 if var1 = 2.

But when I try to set this calculated dimension up in a bar chart, I can only choose fields inside this IF statement, and not any dimension Groups I may have specified.

=if(var1 = 1,DimensionGroup1, If(var1 = 2, DimensionGroup2))

Are there anyone who can help with this?

/Michael

1 Solution

Accepted Solutions
sunny_talwar

I guess you mean cycle or drill down groups when you say "dimension group"? If yes, then you might be able to do what you have listed or you can add both your groups as dimension and make them condition.

for DimensionGroup1 use the condition var1 = 1 and

for DimesnionGroup2 use the condition var1 =2

Capture.PNG

I hope this helps.

Best,

Sunny

View solution in original post

3 Replies
JonnyPoole
Former Employee
Former Employee

You can .  But wrap the group names in [] brackets.

=if(var1 = 1,[DimensionGroup1], If(var1 = 2, [DimensionGroup2]))

Also test with $(var1)   ... dollar sign expansion if you aren't getting the desired results.

Alternatively, you could also add both groups to the dimensions and do a conditional show/hide on each dimension so that only 1 is used conditionally

sunny_talwar

I guess you mean cycle or drill down groups when you say "dimension group"? If yes, then you might be able to do what you have listed or you can add both your groups as dimension and make them condition.

for DimensionGroup1 use the condition var1 = 1 and

for DimesnionGroup2 use the condition var1 =2

Capture.PNG

I hope this helps.

Best,

Sunny

Anonymous
Not applicable
Author

Cool, thanks alot. I will go for the show/hide option.

Best,

Michael