Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Nishadvel
Contributor II
Contributor II

Need to change the Percentage value into Number

I need to create the bar chart with X axis values in percentage but the chart value should be shown as Number for Example PA5 should be shown as A=24,B=27,C=1,D=1.Please see the spreadsheet attached for this

6 Replies
vunguyenq89
Creator III
Creator III

Hi,

First you should flatten the table, converting A,B,C,D from columns to values of a single dimension. You can use Crosstable load to do this. Sample script below (I just assume field names "Group" for A,B,C,D and "Metric" for the numeric values).

Data:
Crosstable (Group, Metric, 1) LOAD * INLINE [
PA,A,B,C,D
PA5,24,27,1,1
PA2,31,5,17,0
PA9,38,1,0,14
PA6,3,1,16,32
PA1,2,0,7,44
]; 

Then you can create a stacked bar chart with 2 dimensions PA and Group, and the following measure:

=Sum(Metric)/Sum(TOTAL <PA> Metric)

Final chart should look like this

test.png

Hope it helps!

BR,

Vu Nguyen

vunguyenq89
Creator III
Creator III

Sorry I didn't see your requirement that X axis value should be in % while value labels of the bar charts should be actual number. This is not possible in Qlik Sense as far as I'm aware of - value labels are always in the same scale with axis values.

You may consider having 2 alternative measures: =Sum(Metric) and =Sum(Metric)/Sum(TOTAL <PA> Metric) for end-user to decide which value they want to see. Otherwise you'll need to use an extension.

y_grynechko
Creator III
Creator III

The closest to it you can get with the default qlik sense bar chart is this:

Capture.PNG

You can show the values next to the dimension. 

Nishadvel
Contributor II
Contributor II
Author

Help me to show the chart values in each dimensions.

vunguyenq89
Creator III
Creator III

Hi, the configuration to show value labels is here

test.png

y_grynechko
Creator III
Creator III

That's what I used as a dimension:

=PA &' A: ' &aggr(Sum(['A]),[PA])
&' B: ' &aggr(Sum(['B]),[PA])
&' C: ' &aggr(Sum(['C]),[PA])
&' D :' &aggr(Sum(['D]),[PA])