Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
jasonladicos
Partner - Contributor II
Partner - Contributor II

Is it possible to customize the number of decimal places displayed on x or y axis?

We'd like to customize many of the bar and line charts in our app so that we display label values to two decimal places of accuracy, but adjust axis values so that they do not display decimal values when viewing percentage values, and displaying the % sign.

I can't find any way to accomplish this, but I'm not sure if that is because it's not possible, or because I can't figure out how to do it.

Has anyone successfully done so? If so, how?

 

Consider this made up example

[test_data]:
LOAD * INLINE [
id, name, value, year
1, apple, .164, 2020
2, apple, .1852, 2019
3, apple, .15, 2018
];

Screen Shot 2020-01-07 at 10.44.07 AM.png

Labels (4)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

in measure use dual

something like

dual(measureexpression_formatted_with_decimal, measureexpression_formatted_without_decimal)

put number formatting as measure expression

View solution in original post

5 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try by setting the measure number format to auto

Thanks

Thanks and Regards
Kashyap.R
dplr-rn
Partner - Master III
Partner - Master III

in measure use dual

something like

dual(measureexpression_formatted_with_decimal, measureexpression_formatted_without_decimal)

put number formatting as measure expression

jasonladicos
Partner - Contributor II
Partner - Contributor II
Author

Thanks @Kashyap_R - I updated the post to reflect that the values are meant to be percentages, and I want to display the  values as percentages, with the percentage sign.

Setting the measure number format to auto doesn't work in this case.

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this as @dplr-rn  suggested

dual(Num(Percentage,'##.#0')&'%', (percentage)) as measure

and Change the format as measure expression

Hope this helps 

Thanks

Thanks and Regards
Kashyap.R
jasonladicos
Partner - Contributor II
Partner - Contributor II
Author

Thanks @dplr-rn - your solution worked, though it's a bit unwieldy. It would be nice to be able to control the formatting of the value labels and axis separately.

For anyone having a similar issue down the road, this is the formula I ended up using (in conjunction with setting Number formatting to measure expression.

dual((Round(Sum(value) * 100, .01)) & '%', Sum(value) * 100)