Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I need some help with this task:
- I have a container with tabs for current Sales, discounts, Fees, etc. (Container#1)
- On the same sheet, I have another container with tabs displaying the corresponding rolling 12 Months for Sales, discounts, Fees, etc. (Container#2).
This is the requirement:
When a tab for an object with Current data is selected in Container#1, the corresponding Rolling 12 tab in container#2 should be displayed. That is, selecting Current Discounts Tab in container#1 should automatically display the Rolling 12 for Discounts in container#2.
I thought this would be be a simple task, however, I discovered that triggers are not options available with containers. ( I wonder why, I see users have been requesting this feature for years). I also learned that QlikTech removed some other options that were available on version 11 (my version).
Can anyone share a sample macro on how to accomplish the above task?
Thank you very much,
Miguel Gavidia
Los Angeles, Ca.
Hi Miguel,
As an alternative to using two containers you can try creating an inline table with your metric options:
Metrics:
LOAD * INLINE [
MetricName
Sales
Discounts
Fees
];
Then add a list box using the metricName field and check the 'Always One selected' setting. Finally, use the conditional show option in the layout tab of each chart object. For the Sales charts for example, your condition would be MetricName='Sales'.
You can also do something similar and conditionally hide/show expressions which would only require you to have two charts.
Hi Miguel,
As an alternative to using two containers you can try creating an inline table with your metric options:
Metrics:
LOAD * INLINE [
MetricName
Sales
Discounts
Fees
];
Then add a list box using the metricName field and check the 'Always One selected' setting. Finally, use the conditional show option in the layout tab of each chart object. For the Sales charts for example, your condition would be MetricName='Sales'.
You can also do something similar and conditionally hide/show expressions which would only require you to have two charts.
Don't think a macro would even solve your issue, since you need to trigger it (and there's no trigger on tab selection of container). There is a workaround using text boxes over the tabs of the container, but you might as well use text boxes with actions for your tabs without the container.
Your best bet is to do different way, like using text boxes instead of the tabs to trigger necessary charts. Or the way Wes Elfman suggests with listbox.
Hope this helps!
There are different ways, such as
you can use conditional show based on variable ("Layout" tab) for the charts (without container) and set the variable in buttons; in this way with buttons you manage the visibility of the chart.
I warn you, however, that there is more work to be done with respect to the container
Hi Wes,
Well, considering all the helpful replies I've recieved, I guess there is no other choice but to get rid of the containers.
I will try your approach.
Thank you,
how can I use text boxes over container tabs ?
I just tried right now but using drag and drop the text object finished inside the container!
Drag it slightly off of the chart, so that it doesnt go inside container, and then resize it using the arrows to get it over the tab.
Hope this helps!
ok I did it, but how can I get displayed the container object pressing the button ?
I tried to use the below code:
Set ContainerObj= ActiveDocument.GetSheetObject("CT11")
Set ContProp=ContainerObj.GetProperties
ContProp.SingleObjectActiveIndex = 0
but it doesn't works.
I was missing ContainerObj.SetProperties ContProp
now It works!