Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bronsonelliott
Partner - Contributor III
Partner - Contributor III

How do I make the Y-axis format dynamic

I have an app where I have a list of metrics.  Some of the metrics are expressed as absolute values while others are expressed as percentages. 

I have my Actual format as such

=if([Metric Format] = 'Percent',

num(sum(Actual),'#,##0.0%'),

num(sum(Actual),'#,##0'))

And everything displays on the graph correctly except that the y-axis is not being properly formatted.  How can I make the y-axis display correctly as '#,##0' or '#,##0.0%' list the actual value that's being displayed?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It may work if you move the if() to select just the format, not the aggregation.

num(sum(Actual)

,if([Metric Format] = 'Percent','#,##0.0%','#,##0'))

However, I find it easier to make two separate expressions and use the Expression conditional property to choose between them. That allows for use of the Number format, Axes, etc per expression.

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It may work if you move the if() to select just the format, not the aggregation.

num(sum(Actual)

,if([Metric Format] = 'Percent','#,##0.0%','#,##0'))

However, I find it easier to make two separate expressions and use the Expression conditional property to choose between them. That allows for use of the Number format, Axes, etc per expression.

-Rob

http://masterssummit.com

http://robwunderlich.com

bronsonelliott
Partner - Contributor III
Partner - Contributor III
Author

Thanks Rob!  Your second suggestion of making separate expressions plus the conditional property is exactly what I need.