COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Chamopak on 26 Jun 2019 01:45:21 PM

Title: Split member name from DataItem1 into DataItem2 and DataItem3
Post by: Chamopak on 26 Jun 2019 01:45:21 PM
Hi,
I am trying to split the member name into 2 parts.
Is this possible, and if it is, please help me with these steps.


Data item 1                           Data Item 2   Data Item 3
1111000 - Text text text text   1111000           Text text text text
Title: Re: Split member name from DataItem1 into DataItem2 and DataItem3
Post by: adam_mc on 26 Jun 2019 02:23:53 PM
Use the position function to determine the position of the '-' assuming that is your delimiter between the the two fields.
Let's say this returns a value of X.
Then, for Data Item 2, substring out from position 1 thru (X-2) and for Data Item 3, substring out from position (X+2) thru the end.

Hope this helps.
Thanks,
Adam.
Title: Re: Split member name from DataItem1 into DataItem2 and DataItem3
Post by: Francis aka khayman on 10 Oct 2019 01:26:29 PM
adam's solution is good.

just for info purposes there is also a macro called split. i however have not tested it and am not sure if it will work for your particular example