Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Trouble using set analysis in a calculated dimension

Hello,

I'm trying to use set analysis within calculated dimensions in a pivot chart to get group descriptions, however they keep coming back with errors.

Here is an example of one of my calculated dimensions

=Only({<Category = {'Group1'}>} Description)

In another dimension I'll have this:

=Only({<Category = {'Group2'}>} Description)

If I use the IF function, I seem to get what I'm looking for, but I've been told it's not best practice to use if statements within calculated dimension.

1 Solution

Accepted Solutions
Qrishna
Master
Master

Did you aggregate with respect to the other dimensions used in the chart/

Try:

AGGR( Only({<Category = {'Group1'}>} Description) ,ChartDimension2,ChartDimension3)

Other expr:

AGGR( Only({<Category = {'Group2'}>} Description) ,ChartDimension2,ChartDimension3)

View solution in original post

3 Replies
Qrishna
Master
Master

Did you aggregate with respect to the other dimensions used in the chart/

Try:

AGGR( Only({<Category = {'Group1'}>} Description) ,ChartDimension2,ChartDimension3)

Other expr:

AGGR( Only({<Category = {'Group2'}>} Description) ,ChartDimension2,ChartDimension3)

Anonymous
Not applicable
Author

This is what I was missing.  I didn't know that I had to use aggregation with respect to all the other dimensions in the chart.

Thank you Krishna.

Qrishna
Master
Master

Awesome.

Happy Qliking