Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ckyrosis
Contributor II
Contributor II

100% Stacked bar but show count values as data labels

I have a stacked bar with years as dimension and the split of genders as measures. 

ckyrosis_3-1756374859943.png

I want it to be a 100% stacked bar like this so that the bars are of equal lengths across all years, but I want the data labels to be the count value instead of the % value. 

ckyrosis_2-1756374840507.png

These are the current options that I have on the presentation menu. 

ckyrosis_4-1756374942935.png

 

Labels (2)
1 Solution

Accepted Solutions
lennart_mo
Creator II
Creator II

Hi @ckyrosis,

to achieve this you need to use the DUAL() function in your expression and set the Number formatting to 'Measure expression'. 

So your Measure would look like this:

=Dual(CountExpression, PercentageExpression)

That way it returns one text value, the first expression, and a numerical value, the second expression.

lennart_mo_1-1756384259986.png

Just keep the segment labels enabled and you should get your desired result.

Best regards

Lennart

View solution in original post

2 Replies
lennart_mo
Creator II
Creator II

Hi @ckyrosis,

to achieve this you need to use the DUAL() function in your expression and set the Number formatting to 'Measure expression'. 

So your Measure would look like this:

=Dual(CountExpression, PercentageExpression)

That way it returns one text value, the first expression, and a numerical value, the second expression.

lennart_mo_1-1756384259986.png

Just keep the segment labels enabled and you should get your desired result.

Best regards

Lennart

ckyrosis
Contributor II
Contributor II
Author

Worked perfectly, thank you! 

ckyrosis_1-1756387179986.png