Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MalcolmCICWF
Creator III
Creator III

Button to Show/Hide a Calculated Dimension


I have a calculated dimension in a chart to display only specific months. I would like to create a button to somehow show this field as the calculated dimension I have set, then if pressed, the button would would turn off the dimension and display the whole field. I have not done a lot of work with button and I am not sure how this would be set up and if it would involve a macro of sorts.

Can anyone help me or point me to an article explaining how this is set up?

1 Solution

Accepted Solutions
rajat2392
Partner - Creator III
Partner - Creator III

check this one..it will not add it, instead replace it as u require....

View solution in original post

20 Replies
Not applicable

Hi Jeremy,

you may like something like this....

Regards

Darek

rajat2392
Partner - Creator III
Partner - Creator III

you can set two dimensions, one calculated dimension, and other the full dimension. Check for both dimension as conditional dimension.

create a variable and trigger the variable value with a button. For ex- in button action tab, add for external>set variable

give variable name and value as "if(variable=0,1,0)"

now set one of the dimension condition as variable=0

and other variable dimension as variable=1

MalcolmCICWF
Creator III
Creator III
Author

so using the link from Dariusz, I set all of this up, but it is toggling on the extra dimension, but not hiding the other. I need one to show at a time

Capture.JPG.jpg

Not applicable

Maybe you need simple turn off conditon for one Dimension?

MalcolmCICWF
Creator III
Creator III
Author

I am not sure how to make this possible, this seems like it is harder to do than should be. Maybe I need to take a drill-down or cyclic group approach

Not applicable

Maybe you may share your application and we will try to set it for you

Greg_Williams
Employee
Employee

So there are a few approaches:

1. Create a macro

2. Use a button to show/hide the field or change the field used in the Dimension or Expression sheet

3. Create a second chart (one with your limited months) and one showing all of them, create a button to show the appropriate desired chart type

A chart object can be hidden using the show/hide feature available on the Layout tab in the Chart's properties window.

There are numerous examples of showing/hiding items in QlikCommunity if you need the logic.

Hope this Helps you.

~Greg

Not applicable

Jeremy,

i understand, that you want your chart to have more than one state and you want to change state after pressing a button. Am i right? If yes, please show how should your chart looks like in each of states you need.

regards

darek

MalcolmCICWF
Creator III
Creator III
Author

Alright, I hope I am attaching the qvw file correctly.

You will see in the example that when you click the show/hide button, a new row (in black and white) is placed along the top starting with "Period To Date", this will contain all of the dates for that column. The "Period To Date" in the blue and yellow is a calculatied dimension limited to 12 months using that same field.

I am trying to make it so only one or the other shows up, currently it toggles the black and white Column_Fields on and off, while leaving the other there.