Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Presenting chart bars as 100% value

Hi there, I have created the chart below and I'm struggling to get the bars to be represented as a 100% value.

I have added the expression below - any suggestions?

Thanks

Rob

Expression

=Sum({$<Source_Key={1}>}Ans_Percent)/q1_total_sum_perc

Variable - q1_total_sum_perc

=sum ({$<Source_Key={1}>}Ans_Percent)

Div Chart.png

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Hi.

It seems you don't have to discard the dimension totally as you want the ratios for each division:

=Sum({$<Source_Key={1}>}  Ans_Percent)/Sum({$<Source_Key={1}>} TOTAL<Division_Name> Ans_Percent)

And the way you use the variables isn't suitable for this case as it's calculated ONCE for the whole chart.

If you remove the equal sign the content of the variable will be substituted into your expression.

View solution in original post

4 Replies
MayilVahanan

Hi

Try like this

sum(ur expression) / sum(total ur expression)

Ex:

Sum(sales)/sum(total sales

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Mayil, I tried that but wanted to check that I have it right as the result is a bit strange.

I created a variable VarDivPerc which was my expression

=Sum({$<Source_Key={1}>}Ans_Percent)/q1_total_sum_perc

Then applied your suggestion

=Sum(VarDivPerc)/ Sum(TOTAL VarDivPerc)

It came out like this!

Div Chart 2.png

whiteline
Master II
Master II

Hi.

It seems you don't have to discard the dimension totally as you want the ratios for each division:

=Sum({$<Source_Key={1}>}  Ans_Percent)/Sum({$<Source_Key={1}>} TOTAL<Division_Name> Ans_Percent)

And the way you use the variables isn't suitable for this case as it's calculated ONCE for the whole chart.

If you remove the equal sign the content of the variable will be substituted into your expression.

Not applicable
Author

That is excellent, it has worked.

Much appreciated everyone.