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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ashmitp869
Creator II
Creator II

Chart change depending on what measure (Number / percentage) user select

Hi there,

I have a requirement where a user can select the measure i.e show by Percentage or by Number .

How can I implement this :- How to show a user a chart depending on what he choose -

I am using variable like below :

set vDisplayedByShow='Number,Percentage';
set vDisplayedByShow='Percentage';

 

req11.PNG

1 Solution

Accepted Solutions
QFabian
MVP
MVP

Other option is create a inline table:

ShowAs:
LOAD * INLINE [
ShowAs
#
%
];

 

and then use it inside the expression to change the formula :

if( ShowAs = '#', num(Sum (Quantity), '#,00'), num(Sum (Quantity) / Sum (total Quantity), '#,00%'))

QFabian_9-1621899880081.png

QFabian_10-1621899905331.png

 

QFabian_11-1621899915731.png

 

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.

View solution in original post

2 Replies
QFabian
MVP
MVP

Hi @ashmitp869 , one option is having more than one expression, and then group them :

First, create the desired expressions, in this case, 3

QFabian_0-1621899305287.png

QFabian_1-1621899333739.png

QFabian_2-1621899355462.png

 

Then, group them :

QFabian_3-1621899418154.png

and again, group the third expression :

QFabian_4-1621899456860.png

 So, now you have 3 expressions grouped :

QFabian_7-1621899546339.png

And you can change the expression using the button :

QFabian_8-1621899599701.png

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
QFabian
MVP
MVP

Other option is create a inline table:

ShowAs:
LOAD * INLINE [
ShowAs
#
%
];

 

and then use it inside the expression to change the formula :

if( ShowAs = '#', num(Sum (Quantity), '#,00'), num(Sum (Quantity) / Sum (total Quantity), '#,00%'))

QFabian_9-1621899880081.png

QFabian_10-1621899905331.png

 

QFabian_11-1621899915731.png

 

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.