COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Query Studio => Topic started by: nandamuri on 09 May 2023 02:31:58 PM

Title: Help with string split
Post by: nandamuri on 09 May 2023 02:31:58 PM
Hello all, I have a prompt that takes a string which will have text separated by |. For example: abcde|ef|ghi|

The string can be any length and can have any |.

I need to extract like this (below) to compare and find any data that matches to the string.

1: abcde
2: abcde|ef
3: abcde|ef|ghi
3: abcde|ef|ghi% (any thing that starts with abcde|ef|ghi)

I am lost and have no clue on how to do this..any help is apprecated. TIA
Title: Re: Help with string split
Post by: dougp on 09 May 2023 03:29:37 PM
sample input and output please
Title: Re: Help with string split
Post by: nandamuri on 10 May 2023 09:09:34 AM
Thank you, Doug..

So, the input comes from the prompt.
The string entered will have text separated by |. For example: abcde|ef|ghi|

The string can be any length and can have any |.

Now I have to check if there are any matches in the database like this -
1: abcde
2: abcde|ef
3: abcde|ef|ghi
3: abcde|ef|ghi% (any thing that starts with abcde|ef|ghi)