Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

anushahegde
New Contributor III

Alternative Dimensions in Line Chart

Hi all,

Dimension for a  line chart is YearMonth and the measure is Sum(Amount) . I have added 2 other dimensions Year and YearQuarter.

The requirement is when the user selects Year from the alternative dimension, the measure should be avg(Sales) and when he selects YearQuarter form the alternative dimension, line chart should dislay Sum({<Flag=1>}Sales).

Could anyone suggest what is the best way to achieve this?

Thanks in advance,

Anusha.

6 Replies
ogster1974
Honored Contributor II

Re: Alternative Dimensions in Line Chart

perhaps this approah could help.  It uses an extension to set a variable based on the user selection but this then drives the dimension and measure used in a chart.

sagarkharpude
Contributor III

Re: Alternative Dimensions in Line Chart

Create inline table for all this dimensions. Call this Field as Time.

Use Simple field select extension and add this dimension(Time) field to this dimension of Simple Field select.

Use Getfieldselection(Time) in dimension as well as Expression.

anushahegde
New Contributor III

Re: Alternative Dimensions in Line Chart

is there any way other than extensions?

anushahegde
New Contributor III

Re: Alternative Dimensions in Line Chart

Is there any way other than extensions?

sagarkharpude
Contributor III

Re: Alternative Dimensions in Line Chart

I think this is the best way.

anushahegde
New Contributor III

Re: Alternative Dimensions in Line Chart

I tried using len function.

something like this.

if(len([YearMonth ]),

Sum(Amount),

if(len([Year]),

avg(Sales) ...

Community Browser