ReplaceChar() vs Replace()
- 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
So here is my rant/debate between the functions ReplaceChar() vs Replace() in Alteryx. Here is the setup data:
Carr","Bret","D","Carr","Spouse","
I want to replace:
","
With a single underscore:
_
See image below. What I received with ReplaceChar() was three underscores! I'm sure there is a use case for this but I'd love to hear anyone's use case if you have one!
Here is the difference for using the two. I don't see the point of the ReplaceChar () if Replace() can do nearly the exact same thing.
Rant over. 😂
Solved! Go to Solution.
- Labels:
- Expression
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Rant accepted (sorry @Rant , this isn't about you!)
replacechar will replace any characters listed it the specified replacement. If you have "," being replaced, it treats each char independently.
replace looks for the string in its entirety. It replaces "," nicely with a single underscore.
Cheers,
mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Even though I knew this as the answer, I will mark you as the solution as you are 100% correct. 😅
I just don't like having two things that basically do the same thing in different ways and having to figure which is the better choice. Sometimes there are just too many options. haha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
A challenge for you:
without using a unique tool, provide me with 3 ways to find what would otherwise come out of the unique anchor of a unique tool.
cheers,
mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What kind of homework kind of thing is this?!
- Add recordIDs for identification of dupes, run remove duplicates.
- You could run a dynamic input to alter the XML REGEX expression parse value to actual row value, looking for a match under that row (i.e. from 1 down, 2 down, 3, down, etc.) to the end. Any match is a means a duplicate.
- Run REGEXMATCH formula on column.
Not very thorough, but that's where my mind takes me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I've placed a workflow here that has 3 alternative methods (besides CReW macros) to get you to the unique tool output. Care to add to this workflow? I open the gauntlet to others lurking in the post too.
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for sharing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@MarqueeCrew Alternative 1 😲.
My contribution alternative 4 (only if the field 1 is numeric) .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@MarqueeCrew In addition to alternative 4. I wanted to be able to identify unique in a data set without a numeric column + I wanted to add a challenge to do it without using the preparation palette.
