Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
kcm
Contributor II
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.

Labels (3)
1 Solution

Accepted Solutions
kcm
Contributor II
Contributor II
Author

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

View solution in original post

8 Replies
Shubham_Deshmukh
Specialist
Specialist

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
Specialist
Specialist

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
Master II
Master II

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
Contributor II
Contributor II
Author

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
Contributor II
Contributor II
Author

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

employe4_2
Contributor III
Contributor III

Hi i currently trying to do almoste the same , but ain't doing it.

Do you still have your app with good syntaxe ? maybe i assigne also badly my variables...

Thx anyway

odassier
Creator II
Creator II

Hi Kcm,

Can you share a .qvf file example where this work if possible?  I'm having the same issue.

Thanks,

Olivier

employe4_2
Contributor III
Contributor III

Hi,

 

Can you explicit how you do it, with the variable extension.

I try to do the same but with my measure : selecting my field and the measure of my chart adapte, while my dimension stay as Time.

thx