Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to clean up a field and need to apply two functions in the load script. I've read through several other discussion posts and just can't seem to get the right syntax for this to work.
These are the two functions that I'd like to combine (both work as expected on their own). Any help is much appreciated.
If(Len(Trim(Instructor_Name)) > 0, Instructor_Name, 'None Specified') as [Instructor name], //Replaced blanks with text
Replace (Instructor_Name,' ',' ') as [Instructor name], //Removes extra spaces between instructor names
Thanks in advance!
R.
May be this
If(Len(Trim(Instructor_Name)) > 0, Replace (Instructor_Name,' ',' '), 'None Specified') as [Instructor name]
May be this
If(Len(Trim(Instructor_Name)) > 0, Replace (Instructor_Name,' ',' '), 'None Specified') as [Instructor name]
Hi Ryan, you can use Trim to remove the extra spaces:
If(Len(Trim(Instructor_Name)) > 0, Trim(Instructor_Name), 'None Specified') as [Instructor name]
it seems that the OP is looking to making double space into single space.....but I might be wrong...
It was just to give an idea, the comments says "Removes extra spaces between instructor names" but the code will only work if there are exactly two spaces, not three or more.
Sunny, thanks so much. I was trying to add the Replace before/after the Trim, not combining the two as you've done, which is obviously why I didn't work.
R.
Thanks Ruben! I was trying to remove cases where people's names had an accidental double space between first and last. My first attempt at solving this was with Trim, but realized I couldn't use it to remove extra spaces inside a string.
R.
True, I don't know when I started to think that it removes spaces in the middle.