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: 
thakurj
Contributor III
Contributor III

Number format

I need to display number in two different formats in the same measure in a bar chart. The bar chart measure has two measures working on an if condition.

At the click of a button, the format of the number should change from $#,##0 to #,##0.00

The variable routine mentioned in Qlik community works on KPI but not in bar graphs.

https://community.qlik.com/t5/New-to-Qlik-Sense/Number-formatting-in-Qliksense-Bar-Chart/m-p/1400094

Could someone please help me with this.

Labels (1)
1 Solution

Accepted Solutions
justISO
Specialist
Specialist

Hi,

If you approach works in kpi, but not barchart, try to set 'Number formatting' under your barchart measure to 'measure expression' ('auto' should work too, but just in case). If you use MasterItem, try on or off 'Master measure formatting', maybe it cause something.

Be sure to align num format to in report used ThousandSep and DecimalSep symbols (you can find those in Main section in your report script). For example, your format '$#,##0' and '#,##0.00' for me not working, as I use Europe standart, ThousandSep=' '; DecimalSep=','; so for me it works only '$# ##0', '# ##0,00'.
I'm using expression 'num(Sum(value), if(vVar=1, '$# ##0', '# ##0,00'))' and it changes format in all charts:

 

justISO_0-1690975429084.png

View solution in original post

5 Replies
justISO
Specialist
Specialist

Hi,

If you approach works in kpi, but not barchart, try to set 'Number formatting' under your barchart measure to 'measure expression' ('auto' should work too, but just in case). If you use MasterItem, try on or off 'Master measure formatting', maybe it cause something.

Be sure to align num format to in report used ThousandSep and DecimalSep symbols (you can find those in Main section in your report script). For example, your format '$#,##0' and '#,##0.00' for me not working, as I use Europe standart, ThousandSep=' '; DecimalSep=','; so for me it works only '$# ##0', '# ##0,00'.
I'm using expression 'num(Sum(value), if(vVar=1, '$# ##0', '# ##0,00'))' and it changes format in all charts:

 

justISO_0-1690975429084.png

thakurj
Contributor III
Contributor III
Author

Hi @justISO 

Thanks so much for the solution.

The solution works but in a stacked bar chart the total values are still displayed in the auto format, even after selecting the measure format as measure expression. And if I switch the Total values off, the segment values are not big enough to be seen, especially if the bar size is small.

Do you have any idea how to resolve this?

justISO
Specialist
Specialist

Can you provide an example of what totals in bar chart you talking about? Do you mean Segment and Total lables?

thakurj
Contributor III
Contributor III
Author

yes, I mean segment and total lables

justISO
Specialist
Specialist

justISO_0-1691757721520.png

"Auto" below segments/total labels does not refer to the number format, but indicates how Qlik will display the labels. And here's the problem, because you can't tell Qlik to show all labels - it decides for itself and only displays when it fits ("Auto" means that). To see all the labels (or at least most of them) you need to view chart in full screen.