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

any function of replace

Started by div_1234, 30 Aug 2011 01:02:32 PM

Previous topic - Next topic

div_1234

hi
Is there any function , which works like replace  in expression


Thansk

lucasdnd

replace("old substring", "your original string", "new substring")

Example:
replace("ello", "Hello world", "i") returns:
"Hi world"

div_1234

i cant use replace function in cognos expression,i need to find similar function which i can use

lucasdnd

Can't use the replace function? That's weird. As far as I know, it's the only easy way to do it. Are you sure the parameters passed to the function are all Strings?

div_1234


Lynn

Functions available to you and their syntax can sometimes vary depending on the database you are using.

If you post what DBMS you are reporting against, it may help you get better responses to your question.

Some databases have a "translate" function that may help you achieve something similar to "replace".

div_1234

i am using sql server , but there is no function in expression replace


Lynn

Quote from: div_1234 on 31 Aug 2011 03:54:01 PM
i am using sql server , but there is no function in expression replace

I'm not using SQL Server currently, but I'm pretty sure that it supports the replace function:
http://msdn.microsoft.com/en-us/library/ms186862.aspx

I don't understand what you mean when you say you can't use it? Did you try and get an error? Just because you don't see it listed in the functions tab on the expression editor doesn't mean you can't use it (in case that is the issue).

div_1234

hi
i am getting error like the function name was not found near the position 80. CRX-API-0011