Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
anushahegde
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
ogster1974
Partner - Master II
Partner - 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.

sagarkharpude
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.

anushahegde
Contributor III
Contributor III
Author

is there any way other than extensions?

anushahegde
Contributor III
Contributor III
Author

Is there any way other than extensions?

sagarkharpude
Creator III
Creator III

I think this is the best way.

anushahegde
Contributor III
Contributor III
Author

I tried using len function.

something like this.

if(len([YearMonth ]),

Sum(Amount),

if(len([Year]),

avg(Sales) ...