String Manipulation in Rational Cognos Report Studio
Hi,
I would like to ask if anyone knows how to perform string manipulation in Cognos Report Studio? I have queried data from RQM with a name format "SprintNumber-Project-TestType-Other". I need to query data based on 'TestType' and create a table for them. So basically I need manipulate the name string, use the dash(-) as a filter and get the third field so i can have a list of test cases with which belongs to the same TestType.
It would be appreciated if anyone can provide information on how we can achieve this on the report. We are using IBM Cognos Report Studio Version 8.4.1.
Thank you in advance.
I would like to ask if anyone knows how to perform string manipulation in Cognos Report Studio? I have queried data from RQM with a name format "SprintNumber-Project-TestType-Other". I need to query data based on 'TestType' and create a table for them. So basically I need manipulate the name string, use the dash(-) as a filter and get the third field so i can have a list of test cases with which belongs to the same TestType.
It would be appreciated if anyone can provide information on how we can achieve this on the report. We are using IBM Cognos Report Studio Version 8.4.1.
Thank you in advance.
One answer
We do a lot of string manipulation in Report Studio and I use the Cognos string functions, most commonly a combination of the 'substring' and 'position' functions.
http://pic.dhe.ibm.com/infocenter/cbi/v10r1m0/index.jsp?topic=%2Fcom.ibm.swg.im.cognos.ug_cr_rptstd.10.1.0.doc%2Fug_cr_rptstd_id59246_substring.html
For a simple example, to get all text after the first '-' in your data item you'd do something like this:
http://pic.dhe.ibm.com/infocenter/cbi/v10r1m0/index.jsp?topic=%2Fcom.ibm.swg.im.cognos.ug_cr_rptstd.10.1.0.doc%2Fug_cr_rptstd_id59246_substring.html
For a simple example, to get all text after the first '-' in your data item you'd do something like this:
substring([Field], (position ('-', [Field]) + 1))I know I've ended up with some pretty complex nested substring/position combinations depending on what I'm parsing out, but hopefully this points you in the right direction.