If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to use Regular Expression in report studio

Started by ravimahazan84, 22 Nov 2012 06:51:40 AM

Previous topic - Next topic

ravimahazan84

Hi All,

Anyone having Idea how to use regular expression in report studio,please share your experience,Thanks.

Ravi

wyconian


ravimahazan84

hi,

For example employee name contains some specific special character pattern then i want to apply regular expression for the same to identify all such name with that pattern.

thanks

wyconian

If you can code it you can add it to the query as a query item or calculation

norkos

Cognos dosn't support regexp filter by default, but there are tricky workarounds.

First you have to check, that you DB provider support regexp or not - like Oracle regexp_like filter function.
If your DB provider support such functions, than you have to configure Cognos to interpret this new function.
To do this you have to modify some XML files, which is quity tricky. I recommend to make it only if you can't create the filter with common function.

If you can't create you filter with common functions as substring and like, then let me know and I will send you detailed information about the XML modification.

ravimahazan84

#5
Hi Wyconcian,

Do u have any example with you as i can write code for the same but where to add it.

Hi Nor,

Can u send me that XML thing it will be helpful to me.
my email address is   <removed>

wyconian

I would just drag a data item or calculation onto your report/query and add there code there

blom0344

Quote from: norkos on 26 Nov 2012 03:42:39 AM
First you have to check, that you DB provider support regexp or not - like Oracle regexp_like filter function.
If your DB provider support such functions, than you have to configure Cognos to interpret this new function.

This would mean adding native functions to the package definition the report works on. You can add these in the package definition prior to publishing..

norkos

@Blom: It doesn't mean just addig vendor specific function set to the package in FWM prior publishing, bacause the correspondent Cognos config files don't contain all DB level functions. E.q.: They don't contain the regexp_like Oracle function even you have add Oracle functions to the package. So in some cases this need also XML modifications prior you can add the new function to your package.

@Ravi: Here you can find a detailed description from IBM about how to add new DB functions - also user-defined - to your Cognos system: http://www-01.ibm.com/support/docview.wss?uid=swg21339781
If your Cognos has a multiserver architecture than you have to do the same modifications on every nodes.

blom0344

Fair enough, but the point I was trying to make is that you need to enable working with native RDBMS functions in the first place through the methode described..