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: 
kunkumnaveen
Specialist
Specialist

how to get percentage on bars

Hello All,

is it possible to show both value and percentage on each bar in bar chart..

dimension:category ,decision

expression i wrote :=count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS)

i am able to get value on each bar now i need percentage of each bar from total .As you see in screen short total is:50718, and this value is divided in to three diff bars    1)43512

                                                  6626

                                                    580

                                              50718

i tried by enable relative option but i get only percentage but i need both value and percentage ,

shall i write another expression for percentage and change chart to combo chart will it work?

thanks

naveen

22 Replies
settu_periasamy
Master III
Master III

Try this..

=Dual(count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS) &'('& Num(

  count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS)/

  count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}TOTAL PRUEFLOS)

,'#,##0.0%')&')',

count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS))

Number Tab -> Expression Default

kkkumar82
Specialist III
Specialist III

For your thing try like this

Dual(count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS) & Chr(10) &

Num(count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS)

/

count( Total {$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS), ' #,##0.00%'))


,



count({$<Category={'Smelting'},MaterialName=,YEAR=,QUATERS=,name1=,ENSTEHDAT={">=$(vFromdate)<=$(vTodate)"}>}PRUEFLOS)



)



as expression

kkkumar82
Specialist III
Specialist III

Agreed with Settu Number format should be " Expression default"

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Attaching other way of doing that using Bar chart.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
HirisH_V7
Master
Master

Hi,

May be like this,

PFA,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
kunkumnaveen
Specialist
Specialist
Author

when i use single dimension its working fine but when i  use same with two dimension its not working ...will it not work for two dimension ?

kkkumar82
Specialist III
Specialist III

What you mean by not working , can you attach a pic or let us know what has happened

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Naveen,

It will be helpful if you give more details like what all things you are doing.

Which solution are you using which I have suggested.

Before If you are using 1st Solution, it will not work because Combo Chart will not work with multiple dimension and multiple expression.

So if you want to use the multiple dimension, you must try my second solution, where you will have multiple dimension and single expression.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
kkkumar82
Specialist III
Specialist III

Hi Naveen,

PFA , used dual , it even works for two dimensions, but the graph doesn't look good if you have more number of dimensions.

Kiran Kumar

kunkumnaveen
Specialist
Specialist
Author

So if you want to use the multiple dimension, you must try my second solution,


where is it will you send it again please