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

Distinguishing Between Charts

Hello Qlik Community,

I wanted to ask a simple question that I think can be done but I am not sure how to do.

So I have 2 data sets: OLD and NEW. I created two straight tables: one for OLD and one for NEW.  SO now 2 straight tables are on my sheet now. Is there a way for me to put a button to distinguish between OLD and NEW?

I want a button so if I click an OLD button, only the OLD straight table will be shown and the NEW straight table will be hidden and vice versa.

So basically, is there a way to create a filter that distinguishes between different sheet objects?

I hope I correctly explained what I am trying to accomplished. This would be a big help to me. Thanks in advance!

8 Replies
deec
Creator
Creator

You sure can. There are lots of techniques to accomplishing this. The basic information you need is:

All objects have an Object ID (Properties > General Tab)

All objects have a Show property (Properties > Layout Tab)

     You can switch the Show property to Conditional

          If the conditional is false or 0, then the object will be hidden. If it is any other number or true, it will be shown

          You can use a variable in this field

You can add variables (Settings > Variable Overview)

     Add a variable and name it something memorable (like "variable")

You can create a button that assigns values to a variable

     New Sheet Object > Button > Actions Tab > Add > Action Type: External , Action: Set Variable

     In the Variable box choose your variable

     In the Value box type =NOT $(variable) -- this will simply cycle it between true and false every time you click it.

Now go back to your two charts you created.

You can enter $(variable) into the Show Conditional property in the Layout tab for one. And NOT $(variable) for the other.

The end result is that one of them will show when the variable is true, the other when the variable is false.

Lastly, position them in the exact space with the same size, and it will appear as if every time you flip the button, the values change. The user won't have a clue that it is a separate chart.

Hope that helps

maxgro
MVP
MVP

an example in the attachment

Not applicable
Author

Hey Damian,

Thanks for your reply. Do I need to add a condition where I write something like =if (variable, 0,1,0) in the conditional tab?

I followed the steps you mentioned but I feel like I am missing a step. So I went to the variables tab and added a new variable called 'variable'. Then I created a button and in the variable box I chose my variable and put =NOT $(variable) in the Value box.

I also put $(variable) in the conditional box in layout for one chart and NOT $(variable) for the other, but when I put them on top of each other and clicked the button, the values were not changing and it appears as if nothing was happening. Do I need to change something in the Layer tab? Or am I just missing a step?

Thanks

Not applicable
Author

hey maxgro,

Thank you for your reply. I can't seem to find an attachment to your reply though. Please help me locate this if it is attached. Thanks.

-Tej

Not applicable
Author

Hey guys,

Never mind, I found the solution to my problem. I just had to add the if statement to the Value box.

Thanks a lot for the help and the quick replies!! It is very much appreciated!

Best,

Tej

Anonymous
Not applicable
Author

Hi Tej,

In order to see attachments, you will need to view the thread in the community itself rather than through your Inbox & Activity section of your profile. When viewing in the Inbox & Activity section, after you click on a line item to view more detail, you can click on the blue thread title to go to the actual thread. There you should see the attachment included with replies.

Here is a direct link to this particular thread: Re: Distinguishing Between Charts


Please also take a moment to mark replies as Correct or Helpful as well.


Let me know if you need any further assistance.

Regards,

Qlik Community Team

varshavig12
Specialist
Specialist

You can use a Container...

deec
Creator
Creator

You're absolutely right, I did miss an important instruction using that technique.

The starting variable value should be set to 1 or True. Otherwise, when you push the button, NOT $(variable) would be trying to reverse a value-less object.

could this be the problem?

I can upload a simple example if you still need it today.