Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jamey_copeland
New Contributor

General Reference to X Axis Dimension

Hello,

I am creating a reference line on a scatter chart where the x axis is set by a drop down from the variable extension. I would like to change the reference line expression depending on the axis value.

So far I have tried something like this:

Median(Aggr(Sum({$<BookFscYearStr = {'2017'}, FiscalQuarter = {'Q1'}>}NETSALESAMTUSD), If(vVariableSelector = 1, Region,Platform))

The expression doesnt seem to like the If Statement in the Aggr function.

I was thinking that if there was a generic way to refer to the x dimension than this wouldnt be an issue.

Something like:

Median(Aggr(Sum({$<BookFscYearStr = {'2017'}, FiscalQuarter = {'Q1'}>}NETSALESAMTUSD), x.dim)

However I havent found a way to generically refer to the x dimension.

Any ideas?

3 Replies

Re: General Reference to X Axis Dimension

How do you change your dimension? If the variable decides which dimension to use, then this could work

Median(Aggr(Sum({$<BookFscYearStr = {'2017'}, FiscalQuarter = {'Q1'}>}NETSALESAMTUSD), $(=If(vVariableSelector = 1, 'Region', 'Platform')))

jamey_copeland
New Contributor

Re: General Reference to X Axis Dimension

Hello,

Unfortunately this still isnt working. I have verified that by putting the variable in a text area that the values are changing from 1 to 2, but I dont think the aggr function likes the if statement in the second argument.

Jamey

Re: General Reference to X Axis Dimension

Would you be able to share a sample to show the issue?

Community Browser