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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add a calculated dimension to a chart from a VBScript macro ?

Hi all,

I need to create a bunch of graphs and wanted to quickly write a little macro that would replicate the same layout for all the required graphs.

So I started to write some lines of code but quickly hit a problem.  Here is the (simplified) code:

Function CreateGraphs()

  Set chart = ActiveDocument.ActiveSheet.CreateLineChart

  chart.AddDimension "=IF([DeterminationCode]='XYZ', [SamplingTime])"

  chart.AddExpression "MeasurementValue"

End Function

For some reason, this line "chart.AddDimension" is silently ignored.  If I add the same calculated dimension interactively: no problem, all is working perfectly.  But I'm unable to reach the same result via the macro.

It looks like this issue has already been raised in a previous post but I could find the right way to workaround the issue.

Any suggestion to help me?

Thanks a lot, have a great day.

--

Gaëtan

10 Replies
Not applicable
Author

Stefan,

Thanks for your help, I finally found it:

chart.ChartProperties.NumericX = True

Have a wonderful day.