Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
grajmca_sgp123
Creator
Creator

How to set Button actions on YTD,QTD Variables

Hi Exports,

I have Gauge Chart with Sum(Sales) expression.

My Requirement is I am trying to view the data on Gauge chart based on YTD,QTD and MTD.

To achieve this I have created variables for YTD ,QTD and MTD.

I want to use this YTD variable as button so I i click on this button I want to see year to till date data in Gauge object.

please provide your suggestions how we can achieve this.

thanks in advance

4 Replies
sinanozdemir
Specialist III
Specialist III

Hi Rajesh,

Per @sunindia‌ suggestion, I am attaching a sample qvw and hope that helps.

First create three variables. In my example, I created two in order to demo:

vYTD and vMTD and set them to 0:

Capture.PNG

In your expressions, check "Conditional" and insert your variables accordingly:

Capture2.PNG

Capture3.PNG

Then create two buttons and name them YTD and MTD. You will need to assign actions to these button. I first assigned an action that gives the value of 1 to variable vYTD when "YTD" button is clicked.

Capture4.PNG

The second action is to change the variable of vMTD to 0 when YTD button is clicked. As a result of this, YTD will appear and MTD will disappear:

Capture5.PNG

Follow the same for the other button:

Capture6.PNG

Capture7.PNG

As a result of this, when you click on YTD button, YTD will appear and MTD will disappear:

Capture8.PNG

And vice versa:

Capture9.PNG

Hope this helps

sunny_talwar

sinanozdemir I feel it would be a good idea to post your sample with your response, since you made one. Sometimes it makes it easier for people to understand when they have a sample in front of them.

This is my personal opinion and you can disagree

Best,

Sunny

sinanozdemir
Specialist III
Specialist III

Hi Sunny,

I totally agree. I just don't have a licensed version on my personal computer and didn't have a sample dataset available at the time of the reply. At work, the security is quite tight that I cannot upload or download anything.

Anyway, I am attaching a sample qvw for Rajesh and if you would like to modify it, please do so.

Thank you.

sunny_talwar

Thanks Sinan‌ for uploading a sample, I am sure Rajesh will agree with me.

Your sample is great and makes perfect senese. I don't think any updates are required, except if grajesh.sgp‌‌is looking for something else.

Best,

Sunny