Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Guilgo
Partner - Contributor III
Partner - Contributor III

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

Labels (3)
1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

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:

Aurelien_Martinez_0-1694440117513.png

 

And my button

 

Aurelien_Martinez_1-1694440147730.png

 

 

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

2 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

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:

Aurelien_Martinez_0-1694440117513.png

 

And my button

 

Aurelien_Martinez_1-1694440147730.png

 

 

Help users find answers! Don't forget to mark a solution that worked for you!
marcus_sommer

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))