Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

use Macro to change Number Format Setting

Dears,

I have a chart with Expressions that need show different data format depends on selection:

eg:

if '%' is selected, the number format in chart should show %. (In properties, there is tab called Number Format Setting, the 'Show %' should be tick in that case).

But if 'Actual Number' is selected, % would be disappear in chart (the 'Show %' box shouldn't be unticked).

Does anyone know how to use macro to control it?

Thanks a lot [8-|]

3 Replies
Anonymous
Not applicable
Author

There is no need for macro. A "normal" way is to create two expressions, one for % and another for actual number, and group them in cycle. Define format for each in "number" tab.
One expression with different formats is possible as well, and also without macro. Define data format conditionally directly in expression, for example:
num(<your expression>, if(Var='%', '#,##0.00%', '###,###'))
And, use "Expression default" on number tab.

Not applicable
Author

In case anyone does need to do this via a macro for other reasons, try this thread:

Dynamic Chart Macro and Number Format Problem

Not applicable
Author