Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
napac1458
Contributor II

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
krishna_2644
Valued Contributor III

Re: Trouble using set analysis in a calculated dimension

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)

3 Replies
krishna_2644
Valued Contributor III

Re: Trouble using set analysis in a calculated dimension

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)

napac1458
Contributor II

Re: Trouble using set analysis in a calculated dimension

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.

krishna_2644
Valued Contributor III

Re: Trouble using set analysis in a calculated dimension

Awesome.

Happy Qliking