COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: mgregory24479 on 20 Sep 2018 10:53:37 AM

Title: Replace Function with an aggregated field
Post by: mgregory24479 on 20 Sep 2018 10:53:37 AM
I have a field that is really a concatenation but in Oracle its called aggregate. What we have is multiple values in one field that come across as this:

ABC Company: $50000 // BCE Company: $2000

We created a calculation using this syntax:
replace([GIVINGHISTORYBYALLOCATION],' // ',chr(13)+chr(10))
returning the results of:
ABC Company: $50000
BCE Company: $20000

I want to remove the dollar amounts from both line items. I have tried REPLACE( Column, RIGHT(Column, 3), '' ) but I am getting an error.

Any thoughts?
Title: Re: Replace Function with an aggregated field
Post by: sdf on 20 Sep 2018 12:32:08 PM
What is the error you are getting?

as far as I can remember the syntax for replace is :

replace([stringItem], '<what will be replaced>', '<what to replace>')

so for you :

replace([stringItem], '$' , ' ')

cheers!