Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Cloud Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Cloud.
SOLVED

Split Data

MoeShow
7 - Meteor

Hello I'm having issues with putting together a formula that allows me to change anything with an Auth0 name to Okta and anything with an Okta name to Auth0 after the dash. I cannot get the formula to read in sequence. It only makes the change 1 way. For example, if the name reads Business Operations - Auth0 I need it to read Business Operations - Okta and so on. I need to keep the preceding text and only flip the name after the dash. 

 
 

 

Screenshot 2023-09-18 165526.png

 

3 REPLIES 3
PangHC
12 - Quasar

we can add more text to generate a unique text to replace the target text.

like this case we add "- " in front.

 

replace([Dept - BU], "- Auth0","- Okta")

MoeShow
7 - Meteor

The issue I'm coming across is it only changes it one way. I need anything that says Auth0 at the end to change to Okta and anything that says Okta at the end to change to Auth0. 

Peachyco
11 - Bolide

You can solve this with an IF-ELSE statement in a Formula Tool: 

  • If the string has "- Okta", switch it to "- Auth0"
  • Else if the string has "- Auth0", switch it to "- Okta"

 

Alteryx - MoeShow Split Data.png

  

Here is my output. Note that I added a new column just to demonstrate the effect - for your case, you should overwrite the existing [Dept-BU] column.

  

Alteryx - MoeShow Split Data b.png