Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

incorrent number format on y axis - combo chart

Hello.
I'm having problem getting the right number format to display in the combo chart on y axis.
Here's my rough expression:
if(MetricName='MetricA'  ,num(sum({<Month={'<=$(=Max(Month))'}>} GrossProfit)/sum({<Month={'<=$(=Max(Month))'}>} NetSales), '##.#%'),
if(MetricName='MetricB', money(sum({<Month={'<=$(=Max(Month))'}>} Actual))).
I have a list box MetricName where users select their metrics. There are a lots of metrics with different number formats (currencies, percentages, whole numbers). In this case, if user selects MetricA, number format changes to percentage in the chart like so:

As you can see the value of expression is 71.9%, but the scale on the left is roughly 0.719%. It seems the y axis number format doesn't inherit percentage number format from the expression. I want the scale to go up to 100%, not 1%. In the number format settings I have the option 'Expression Default' selected.
1 Solution

Accepted Solutions
Not applicable
Author

Thanks Ashutosh, your solution seems to work.

However, it seems I found another way that suits my problem better.

I’m using variable (let’s call it vFormatGraph), which specifies the correct number format for each of my metrics:

if(Data_Type ='Currency','$#,##0.;($#,##0.)',
if(Data_Type ='Percentage', '##.#%'))

Then I’m using this expression to calculate my actuals:

=num($(vActual), '$(vFormatGraph)')

In the chart, under number format, I selected ‘Expression Default’. This solution works perfectly.

View solution in original post

4 Replies
Not applicable
Author

You said " have a list box MetricName ": is it a metric group? It's the easiest way to do that. And in the "number" sheet you can choose how display each metric

Not applicable
Author

Hi,

I believe you will need to use two expressions to show this and that will be more efficient approach also (when in Version 11, we have conditional expresisons).

because when you use one expression and two different formatting on the basis of conditions, Qlikview will try to decide one format for expression to show on

axis when rendering chart and it is different from the values shown on bars etc. for example just set your number format for a

that is the reason you are not able to switch formatting on axis.

For version 10, I have made a workaround which will help you to solve your issue.

Please find the attached file.

It is not a perfect answer to your query but hope it helps.

..

Ashutosh

Not applicable
Author

Thanks Ashutosh, your solution seems to work.

However, it seems I found another way that suits my problem better.

I’m using variable (let’s call it vFormatGraph), which specifies the correct number format for each of my metrics:

if(Data_Type ='Currency','$#,##0.;($#,##0.)',
if(Data_Type ='Percentage', '##.#%'))

Then I’m using this expression to calculate my actuals:

=num($(vActual), '$(vFormatGraph)')

In the chart, under number format, I selected ‘Expression Default’. This solution works perfectly.

Not applicable
Author

oh...great..