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

Adding a "+" to spaces

Started by jessimica602, 30 Jun 2021 04:05:31 PM

Previous topic - Next topic

jessimica602

Hey all,

Maybe I'm going about this all wrong or maybe someone has a better idea on how to do this...
I am trying to add a link to my report that has a google link to for finding the distance between two address; an example of the link is https://www.google.com/maps?f=d&source=s_d&saddr=9666+Old+Katy+Rd,+Houston,+TX+77055&daddr=901+Corbindale+Rd,+Houston,+TX+77024

I have the two fields for the addresses but can't figure out how to add the "+" in the spaces. Does anyone have an idea how to get this done, or a better idea how to handle this?

Thank you!!!!

BigChris

Hi - you don't say what platform you're using, but if you're using SQL Server there's a function there that sounds like it would work for you:

replace ( string_expression1 , string_expression2 , string_expression3 )
Replaces all occurrences of "string_expression2" in "string_expression1" with "string_expression3".

jessimica602

Sorry for the long wait on this

Not SQL Server, just using query calculations in Cognos 11

I tried replace out of curiosity    replace([EE address Full],' ', '+')

but get the following error: "UDA-QOS-0006 error  UDA -SQL-0219 The function "replace" is being used for local processing but is not available as a built-in function, or at least one of its parameters is not supported"

I'm digging around seeing if there is any other solution to this.

Thank you!

jessimica602

Got it to work!!!!!!!!

Thank you!

bus_pass_man

Would it be a violation of the Official Secrets Act to describe how you solved the problem, in case other people wish to do the same thing?

jessimica602

I am so sorry for the late response!!!
I didn't actually get the + to work... Google search did the work for me.

I have the following setup and working just fine:

Full Work Location Address field:  [Address 1 (Location)]+' '+[Facility City, State Zip Code]
Full EE Address Field: [Address Line 1 + Address Line 2]+' '+[City, State Zip Code (Formatted)]
Google Map Link Field:  'https://www.google.com/maps?f=d&source=s_d&saddr='+[Full Work Location Address]+'&daddr='+[Full EE Address]