Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
canmarroig
Partner - Creator
Partner - Creator

Substringcount function.-

Goodmorning, someone is able to help me to answer this question: can SubStringCount extract more than a value from a concatenation of numbers?

as this: 

SubStringCount of(Concat(_metricsNo, '|'), 1 and 5 and 7).

I tried in different ways but i can't find a solution maybe substring isn't the right funciont for my purpose.

Thank you

Anna

1 Solution

Accepted Solutions
whiteline
Master II
Master II

I think you could use match() function instead.

Because you don't want to split the string but want to test if it contains some list of substrings.

=match(_metricsNo, '1', '5', '7')>0

View solution in original post

5 Replies
whiteline
Master II
Master II

What do you mean "more than a value from a concatenation of numbers" ?

SubStringCount - counts the substrings

SubField - finction that returns the substring by its order number.

upd:

Also SubField coud be used in load statement without specifying the number of substring.

In this case it loads every substring as a different row (repeating the other field values)

Not applicable

Hi Anna,

you can use loop with SubStringCount value as its upper value and  with SubField statement read corresponding token and assign it to variable.

The other option is to use SubField within load statement.

regards

canmarroig
Partner - Creator
Partner - Creator
Author

Sorry, my question isn't complete, as per my previous post http://community.qlik.com/message/250222 I'd like to use Substing funcion to condition visibility, in this case i have a table with different columuns that, depending on a list of metric, compare total with other parameters. For example 'quantity" should be visible only when I select 'sum (Sales)' or 'sum(Profit)' not for Geographic info. My purpose is not to duplicate the same columns for every metrics.

Thank you

whiteline
Master II
Master II

I think you could use match() function instead.

Because you don't want to split the string but want to test if it contains some list of substrings.

=match(_metricsNo, '1', '5', '7')>0

canmarroig
Partner - Creator
Partner - Creator
Author

Tks!