How to find no of strings in a concatenated string

tejaswini
Contributor

How to find no of strings in a concatenated string

Hi Everyone,

 

I have line items which is the concatenated string 

ex - 123,435,234,678,567,987

I would like to find no of strings present ie 6

 

Could you please help me with this.

 

Thanks

Tejaswini

2 REPLIES 2
Ingilavicus
Certified Master Anaplanner

Hi @tejaswini ,

 

As Anaplan doesn't have a native text counting formula you can use this workaround to find the number of separators in the concatenation, thus giving the number of items concatenated:

 

Number of seperators = LEN(Text) - LEN(SUBSTITUTE(Text, ",", "")) = 5

 

This will give you the number of separators in your case "," in the string, then just do +1 for the number of original items concatenated. 

 

Andris

andrewtye
Master Anaplanner/Community Boss

substitute really is quite a useful function!