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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
tinkerz1
Creator II
Creator II

Pass a variable a text to substring count

Hi ,

How do I pass a variable as text to substring count?

Thanks

T

=SubStringCount($([Curent Spreadsheet]),'\')

4 Replies
oscar_ortiz
Partner - Specialist
Partner - Specialist

Simply wrap the dollar sign expansion in single quotes.

'$(yourvariable)'

tinkerz1
Creator II
Creator II
Author

Thanks, however when continute to expand the formula to

=index('$(Current Spreadsheet)',SubStringCount('$(Current Spreadsheet)','\')) 

It returns zero, why wont index pick up the number?

The next stage is to wrap the above formula inside left('$(Current Spreadsheet)',above formula)

Thanks

marcus_sommer

Your expression searched within a string (your variable) the number of backslashes within them, like:

index('string', 3)

is it what do you want to do?

- Marcus

oscar_ortiz
Partner - Specialist
Partner - Specialist

What is the actual value of your variable?  Also, I don't believe variables can have spaces.