Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

% percent Bar charts

Hi all,

Below is my data in pivot table format in QV, i would like to show data in percentage next to no of Transactions column. % of each group should be respect Segments and another percentage w.r.t Total.

Same pivot chart also needs to be changed to Bar chart with stacked. Both bars has to be scaled to 100%.

                                 

SegmentGroup# of   Transactions
Segment12-3313629
3-4104418
>4993945
Segment2

2-3

462818
3-4173109
>41286426
1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi Manoj,

Try this expressions

=Sum(Transactions)/Sum( TOTAL <Segment> Transactions)


Regards,

Jagan.

View solution in original post

8 Replies
Not applicable

= sum (# of   Transactions)

then

in expression tab check  -> the relative option

Not applicable

HI Manoj

write another expression as below

=sum(Transactions)/sum( total Transactions)

then go to properties -> Number tab

in that select above expression and in right panel select number or interger or decimal limit and

enable the check box show in %

there you go

Regards

$@M

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

This will not work, as it calculates % on entire data. But my requirement is to calculate % of each group in each segment

jagan
Luminary Alumni
Luminary Alumni

Hi Manoj,

Try this expressions

=Sum(Transactions)/Sum( TOTAL <Segment> Transactions)


Regards,

Jagan.

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

=Sum(Transactions)/Sum( TOTAL <Segment> Transactions)

I tried same expression as you have mentioned, but i had use distinct key in Sum to take unique transactionIds.

With Out distinct it is providing expected result.

In that case, the above formula is not working. Do you have any idea, why is this ?

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you are counting the transactions the use Count() like below

=Count( Distinct Transactions)/Count( TOTAL <Segment> Distinct Transactions)


Regards,

Jagan.

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Thanks Jagan,

It was my mistake, Relative check box in expression & percentage in number format both were checked. Because of this getting wrong value.

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you are using below expression then you should not select the Relative option

=Count( Distinct Transactions)/Count( TOTAL <Segment> Distinct Transactions)


If you got the solution please  close this thread by giving Correct and Useful answers to the posts which helps you.


Regards,

Jagan.