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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro - convert String to Number

Hi,

I would like to convert String to Number. I tried this but is wrong

ActiveDocument.GetVariable("Evolution").GetContent.Number

ActiveDocument.GetVariable("Evolution").GetContent.Int

Is there somewhere i can find manual of API VBScript?

Thanks

2 Replies
Not applicable
Author

Use VB syntax:

CInt(ActiveDocument.GetVariable("Evolution").GetContent.String) 'Convert to Int
CLng(ActiveDocument.GetVariable("Evolution").GetContent.String) 'Convert to Long Int
CDbl(ActiveDocument.GetVariable("Evolution").GetContent.String) 'Convert to Double (Decimal)


johnw
Champion III
Champion III

I suspect that you could also use evaluate to do the conversion in QlikView:

ActiveDocument.Evaluate("num(Evolution)")

I could easily have the wrong systax, or simply be wrong. But in general, I try to do as much as I can with QlikView, and as little as I can with Visual Basic. Part of that is that I'm a long way from being a Visual Basic expert. But I also reason that all QlikView developers will understand QlikView expressions, but only some of them will have a good grasp of Visual Basic expressions. So using as much QlikView as possible seems better to me from a maintenance perspective.