Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
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
Highlighted
Master II
Master II

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.

Highlighted
Creator III
Creator III

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.

Highlighted
Contributor III
Contributor III

is there any way other than extensions?

Highlighted
Contributor III
Contributor III

Is there any way other than extensions?

Highlighted
Creator III
Creator III

I think this is the best way.

Highlighted
Contributor III
Contributor III

I tried using len function.

something like this.

if(len([YearMonth ]),

Sum(Amount),

if(len([Year]),

avg(Sales) ...