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

Substring In Macro

Hello,

I am trying to implement a macro that does a field selection, based on a list of items in a variable.

Consequently the variable in question will be a string where the items are seperated by ','.

I tried achieving this through a substring creation.

THat way I get the count of items, as well as can extract the items individually.

Qlikview does not accept the standard macro commands 'Substring' or 'SubStr' .

How can this substring search be done in a Qlikview macro ?

Thank you

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use the instr function. Instr("Hello, World!",",") returns 6 which is the position of the comma in the string. Something else you can use is the activedocument.Evaluate function which allows you to evaluate qlikview expressions.  activedocument.Evaluate("subfield('Hello, World!',',',1)") returns "Hello".


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use the instr function. Instr("Hello, World!",",") returns 6 which is the position of the comma in the string. Something else you can use is the activedocument.Evaluate function which allows you to evaluate qlikview expressions.  activedocument.Evaluate("subfield('Hello, World!',',',1)") returns "Hello".


talk is cheap, supply exceeds demand