Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
gfarrell
Partner - Contributor III
Partner - Contributor III

Setting the Number Format Settings to "Expression Default" in a dynamic chart vb macro

Is there a way to set an expression's format in a Dynamic Chart Macro that will basically follow the "Expression Default" option available on the Chart Properties Number Tab.  

I am currently using the   ..Data.ExpressionVisual.NumberPresentation.fmt  =   '#,##0'  syntax  and would like the expression format to default from the expressions that include  Num(sum(Amount),'#,##0')  syntax....

Thanks in advance.

2 Replies
tamilarasu
Champion
Champion

Hi Greg,

Check the below attachment.

HirisH_V7
Master
Master

Hi ,

May be like this,

Sub CreateLineChart

set chart = ActiveDocument.Sheets("Main").CreateLineChart

chart.AddDimension "ID"

chart.AddExpression "sum(Amount)"

set p = chart.GetProperties

p.Expressions.Item(0).Item(0).Data.AxisData.Units.Unit.v = "$"

p.Expressions.Item(0).Item(0).Data.AxisData.Units.kUnit.v = "1000$"

p.Expressions.Item(0).Item(0).Data.AxisData.Units.MUnit.v = "million$"

p.Expressions.Item(0).Item(0).Data.AxisData.Units.GUnit.v = "billion$"               

chart.SetProperties p

end Sub

Hope this helps,

Regards,

Hirish

HirisH
“Aspire to Inspire before we Expire!”