
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Switch Dimension with a button
I'm new to Qlik and was wondering how to change dimensions with buttons.
Basically I have sales over the last 5 years in a bar chart, and I wanted to create a stacked bar chart with "seller" as the legend, as well as another chart with sales but broken down by "Store".
I came up with the idea of creating a single chart, with my years in line and my sales in column, then switching between salesperson/store with a button.
I created a variable input with 2 dynamics values :
Value : 1
Label : 'Salesperson'
Value : 1
Label : 'Store'
And in my bar graph, I've put 'bar':
pick(VMeasure, Salesperson, Store)
But it doesn't work when I switch, why?
Thank You
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
An example:
My data:
Load
*
Inline [
Product ID, Shipping status , Sale person , Warehouse
A, Shipped ,Mary ,2
B, Preparing , Mark ,1
C, Preparing , Karen ,1
D, Preparing , Katie ,2
E, Shipped ,Mark ,2
F, Shipped ,Karen ,2
G, Preparing , Mark ,1
H, Shipped ,Mark ,1
I, Shipped ,Katie ,1
];
Set vCurrentDim = Sale person;
My bar chart:
And my button

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
An example:
My data:
Load
*
Inline [
Product ID, Shipping status , Sale person , Warehouse
A, Shipped ,Mary ,2
B, Preparing , Mark ,1
C, Preparing , Karen ,1
D, Preparing , Katie ,2
E, Shipped ,Mark ,2
F, Shipped ,Karen ,2
G, Preparing , Mark ,1
H, Shipped ,Mark ,1
I, Shipped ,Katie ,1
];
Set vCurrentDim = Sale person;
My bar chart:
And my button


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just using: pick(VMeasure, Salesperson, Store) returned a string-value which is not considered as dimension. But if you creates from it an adhoc-variable per $-sign expansion it will return a dimension - means wrapping the above with: $(=pick(VMeasure, Salesperson, Store))
