Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

User selected x-axis

afternoon,

I have created an Inline table as:

LOAD * INLINE

[

Date_Num,Date_Group

1,'Date'

2,'Week'

3,'Month'

4,'Quarter'

5,'Year'

];

and would like the user to select an option from the drop down and have it change the grouping of a chart.

I created the Master Item:

IF(Date_Num=1,Active_Date,IF(Date_Num=2,Active_Week.... etc.

but when nothing is selected, it shows all groupings on the x-axis (once the user selects a single option it works as expected)

I have tried adding a MIN(Date_Num) in - but I don't think the x-axis likes that

IF(MIN(Date_Num)=1,Active_Date,IF(MIN(Date_Num)=2,Active_Week....etc.

Has anyone got something like this working before?

8 Replies
ogster1974
Honored Contributor II

Re: User selected x-axis

Something similar using an extension have a look at this Makes Sense to go round in circles

and see if it can work for you.

I changed the context of my chart using a variable and this extension (qsVariable).

Regards

Andy

Not applicable

Re: User selected x-axis

thanks for that - hadn't thought to use a variable.

Was hoping to do it without extensions - it seems like it should be possible.

Tried assigning MIN(Date_Num) to a variable and using PICK(MATCH($(vDateNum),1,2,3.....etc. but same problem when using the calculation on an x-axis.

guessing aggregation isn't allowed on an x-axis!

ogster1974
Honored Contributor II

Re: User selected x-axis

Strange I've been able to use this method to alter the chart from fiscal to reporting quarter in my dashboard.

Not applicable

Re: User selected x-axis

It works when I use the extension, but wondered if it was possible without an extension.

Like I said - as soon as I use MIN(), the x-axis stops rendering.

ogster1974
Honored Contributor II

Re: User selected x-axis

Selecting a filtered value doesn't SET the variable that's why it doesn't work.

Not applicable

Re: User selected x-axis

have set the variable definition to MIN(Date_Num) which sets the variable

Doesn't work when i reference the variable in the x-axis though.

ogster1974
Honored Contributor II

Re: User selected x-axis

Yes but i'm assuming you set that in the load script so you will be setting it once on load not each time the min(date_num) changes.

That is your issue.  The Variable extension allows the user to set the variable.

Not applicable

Re: User selected x-axis

Have attached a simple example

you can see that selecting a "Date_Group" from the filter, correctly sets the text box in the top left, but the chart using MIN will not render

the other chart, not using MIN will render, but if multiple values are selected in the drop down box it doesn't chart the x-axis correctly.

Community Browser