Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
kcm
New Contributor II

Setting variable for a dimension

New to Qlik Sense.  I would like to set 3 buttons (Month, Qtr, Year) and depending on which button is pressed, use that date dimension as the x-axis in a graph.  I thought variables would work.  Eg using the button/set variable action , setting a vYQM to 'recopendt.date.yearmonth' when MTD button is pressed, or vYQM to 'recopendt.date.yearquarter' in the action button for QTR button.  Then using the value of vYQM as the field for my x-axis in my bar graph.  But this doesn't seem to work.

1 Solution

Accepted Solutions
kcm
New Contributor II

Re: Setting variable for a dimension

Thx. I realized I had syntax errors when assigning the variables.

5 Replies
Shubham_Deshmukh
Valued Contributor

Re: Setting variable for a dimension

You can do one thing, you can create one list object containing Month, Year, Qtr option and according to selection you can replace your dimension.

Shubham_Deshmukh
Valued Contributor

Re: Setting variable for a dimension

Just go through REPORTS dashboard from QVW, you can add or remove dimension according to your choice but need to do some changes in data model.

It is qlikview file but will help you in Sense as well. Hope it helps.

Regards

pradosh_thakur
Honored Contributor II

Re: Setting variable for a dimension

Hi 

 

Is this Qliksense? If yes   1: you can use the variable extension to do that.

 

                                              or

                                                   1:  Create a data island table with month, quarter, year in it 

                                                    2: Use if getfieldselections with if else in the dimension

 

-Pradosh

Learning never stops.
kcm
New Contributor II

Re: Setting variable for a dimension

Thanks, but can you give me a simple example?  I thought with the variables I was changing the dimension, but somehow I am not doing it right.

kcm
New Contributor II

Re: Setting variable for a dimension

Thx. I realized I had syntax errors when assigning the variables.