Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show percent in macro

Hello.

I have a chart that its expressions are introduced dinamically by a macro, but I don´t know how to set the option show in %. How can I activate this optinon in the macro???

Thanks.

1 Solution

Accepted Solutions
MayilVahanan

HI

For number presentation in macro:

Sub ChartNumberFormat

set chart = ActiveDocument.GetSheetObject("CH01")

set p = chart.GetProperties

set np = p.Expressions.Item(0).Item(0).Data.ExpressionVisual.NumberPresentation

np.Dec = "."

np.Fmt = "# ##0.00%"

np.nDec = 2

np.Thou = " "

np.Type = 11 'fixed decimal

np.UseThou = 1

chart.SetProperties p

End Sub

But why you can go for macro?

Try like this

Exp:

=num(Sum(Sales),vNum)

In button:

Set variable:

variable: vNum

value: =if(vNum = '#,##0','#,##0%','#,##0')

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan

HI

For number presentation in macro:

Sub ChartNumberFormat

set chart = ActiveDocument.GetSheetObject("CH01")

set p = chart.GetProperties

set np = p.Expressions.Item(0).Item(0).Data.ExpressionVisual.NumberPresentation

np.Dec = "."

np.Fmt = "# ##0.00%"

np.nDec = 2

np.Thou = " "

np.Type = 11 'fixed decimal

np.UseThou = 1

chart.SetProperties p

End Sub

But why you can go for macro?

Try like this

Exp:

=num(Sum(Sales),vNum)

In button:

Set variable:

variable: vNum

value: =if(vNum = '#,##0','#,##0%','#,##0')

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

ThankYou!!!