Left/Right/Trim function (string, char?)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Trying to trim a string with the | character. Example: [string] = this is my comment for today|MID_Pat
Needs to be "this is my comment for today"
The username (which won't always be mine) will always be 9 characters (if that helps). I tried TrimRight([string],"|") but that doesn't work based on the bool "|" operator. I tried Replace([string],"|","@@") and then TrimRight([string],"@@"] ... that didn't work either.
The only way i can get this done is by adding this SQL code in my Alteryx input: Left([string], CharIndex(Char(124), [string]))
(and to make matters worst, Alteryx doesn't understand CharIndex(Char(124) so I can use this inside the workflow)
How can I build this into Alteryx, and not SQL? Why? Because some comments do not have the | character, which then return [string] = "null" in Alteryx; so I'd like to build an "If Then Else" statement in Alteryx.
Thanks for the help!!
Solved! Go to Solution.
- Labels:
- Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Or simply using Text to Columns to split on the | either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
FindString is exactly what I needed! I never knew this function existed! Thank you!
