Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

requirement

i have 4 buttons ,

what i want is on clicking the total,avg and percentage

so when i click on total and then percentage it shud display the percentage in the chart,and when i den swithc to total from avg the chart shud display me % of total value

with the help of variables,

how to do that

18 Replies
prieper
Master II
Master II

Easiest would be to have one button for each calculation and then set a variable (vCalculation) to 1, 2, 3 etc.

As expression you may then enter

= PICK ($(vCalculation), SUM(Cost), AVG(Cost), SUM(Cost)/SUM(TOTAL Cost), AVG(Cost)/AVG(TOTAL Cost))

with different formatting-requirements you may include the formatting as well:

= PICK ($(vCalculation), NUM(SUM(Cost), '#,##0'), ....etc

Peter

Anonymous
Not applicable
Author

am using a combo chart with multiple expressions

how to put condition in chart as well

MarcoWedel

please post a sample application to demonstrate

thanks

regards

Marco

Anonymous
Not applicable
Author

I did it in same way but it's nt working

Anonymous
Not applicable
Author

@IMG_20170702_163522.jpg

Anonymous
Not applicable
Author

So now if I click on sum and % button both the chart Shud display sum in percentages and if I click on from sum button to AVG with %being selected only the chart Shud display AVG in % ,Wil it be possible using only one variable and how to set the values acrdingly in expressions as well as buttons

vishsaggi
Champion III
Champion III

What you mean by sum in %ges can you show your expected output and your expressions for Sum and Avg.

You can just have two buttons with Sum and Avg. Then using IF condition in your chart expression you can do like the one in attached. I am not sure what your expressions are. Change accordingly.

Anonymous
Not applicable
Author

Leave abt the expressions,it's just on two butn click chart is displayed when u switch to another keeping one in common ,

vishsaggi
Champion III
Champion III

Sorry did not get you. You have explain a little or share your expected output. Or using the file i attached in my previous reply let me know what you are expecting?.