Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Long time reader, first time poster.
I have two charts that have the same dimension but different expressions. I really want to create a button that when clicked will flip between the two different charts.
This would be similar to a fast change chart except I am under the impression that is for changing chart types, and is limited to using the same expression in each chart. I want to change the expression being graphed, not necessarily the chart type.
Thanks, any help is appreciated.
What you can do is create a cyclical expression.
First, you define the 2 expressions in 1 chart and drag 1 expression over the other or select the 2nd expression and click the Group button below the expression list.
After clicking OK, a cyclic button will appear at the bottom of your chart. You can move that by selecting the chart and then pressing shift+ctrl on your keyboard that will allow you to move and/or resize certain elements of your chart including the cyclic button.
Regards, Karl
Hi and welcome!
There are some workarounds to your issue. One is to create two different charts with the same dimension but different expressions, and use the conditional show expression under the chart Properties, Layout tab to show one or the other, depending on the action triggered by the button, for example, a variable set to 1 (one chart) or 2 (the other chart).
Another one is to set a variable as expression, say vExpression, and populate the variable with an action of the button (button Properties, Actions, New, External, Set Variable, Variable vExpression):
If(vExpression = 'Sum(Value)', 'Sum(Amount)', 'Sum(Value)')
Then use the variable as expression:
$(=vExpression)
If you want this button to be more similar to the actual fast change icon in the chart, you can create a text object instead, that will let you use actions as well, with transparency background set to 100% without borders and put over the caption of the chart.
By the way, the fast change button allows you to display the same information already shown by the chart (same dimensions and expressions) rendered in different ways, but nothing to do with changing expressions or dimensions themselves, only to the type of chart, like going to the chart Properties, General tab, and clicking a different type of chart.
Hope that helps.
Miguel
EDIT: Yes, Karl's suggestion to use grouped expressions seems to be easier and cleaner.
This might be going a little too far for your requirement, but when I have multiple charts on a tab, and only want some visible at a time, I tend to name them and create a cyclic field group with my chart names, then check for the value of the group as my show condition. See attached.
John, Is there a reason you wouldn't use a container in this case?
Karl Pover wrote:
John, Is there a reason you wouldn't use a container in this case?
Often, my "charts" are a set of related objects that I want to display at the same time. You can see this in the attached example, where the charts display with a list box specific to that chart, and one of the charts is actually two charts displayed together.
So far as I know, containers can only display one object at a time? Am I mistaken? I've only been on version 10 for a short while (we're late adopters).
One object at a time kills containers in my mind. When I first heard of containers, I was hoping you could have a container that displayed multiple objects at once, and then wrap another container around those containers to control which set of objects was displayed. It doesn't seem to have worked out that way. And since containers aren't satisfactory for maybe half of my cases, I'd rather just stick with my current approach so as to present the same user experience across tabs and documents (and versions in my specific case).
As a very minor issue, I also don't see any simple "click here to go to the next object in the container" the way I can with my approach. I think this allows for easier user exploration of the available charts, and I'd like to see that added to containers. Again, I could be missing a setting since I'm so new to version 10.
Anyway, I've tried to do something similar with containers on the second tab in the example. It just doesn't work as well in my opinion.
I'm not telling anyone to NOT to use containers. If they work for people, great, and I'm hoping they get better. But I'm just not satisfied with their current functionality (unless I'm missing something).
Edit: Forgot to attach new example with containers.
I agree, and you're right, having more than 1 object in a container is new to QV 11. However, they can only be combined in a rigid grid.
I would have seen what you mentioned earlier, but selecting the cyclical icon in your app in QV 11 froze up my QlikView. It'll probably be fixed by the time you upgrade to QV 11, but you might want to keep it in mind before migrating to QV 11.
Regards, Karl
First, thanks for all the help.
I tried using the cyclic expression approach that Karl suggested. But it appears you can only group two expressions. What I am trying to do (which was not made clear, sorry) is flip between two different charts that each have multiple expressions.
Chart 1 is sales and margin over time
Chart 2 is three different discounting metrics over time
The fastest way to do it and if you have QV 10, is you create a Container object to swap 2 charts. If you are looking for something more complex, the easiest way to swap multiple charts is using the variable that controls whether an object is hidden or shown. That hidden control is found in the Layout tab in the object properties. You can change the variable value using an action that is triggered by clicking a button.
Please, if you still have questions, tell us which part is unclear.
Regards, Karl
The container object works perfectly, thanks Karl.