Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Replace Characters Help

tmorrison
5 - Atom

Hey community,

 

I'm working through invoice detail to build out a cohort analysis but need some help. Our system includes the month on the end of each service in our invoice descriptions, for example "Recurring Service - January 2023" and then "Recurring Service - February 2023". 

 

However, the month is only included in the invoice description for recurring services and not for one-time services such as repairs. 

 

How can I easily remove " - January 2023" and other respective months when included in the invoice description, but keep the original invoice description if the month isn't present. 

 

Unfortunately hyphens are not unique only to these instances so I can't leverage text to columns. 

 

Thanks!

5 REPLIES 5
binuacs
20 - Arcturus

@tmorrison One question the Recurring Service - January 2023 - is generating at the end of January, the same as Recurring Service - February 2023 is at end of Feb?

 

If that is the case you can use the below formula to replace the month and year

 

binuacs_0-1675888231340.png

 

binuacs
20 - Arcturus

@tmorrison If the month and year can come in any month report then another option is to Find and Replace

 

binuacs_1-1675889475280.png

 

 

binuacs_0-1675889459635.png

 

 

 

 

ShankerV
17 - Castor

Hi @tmorrison 

 

One way of doing this.

Have checked the workflow with different test cases and shared the output for your reference.

 

Let me know if you have more questions related to the same.

 

ShankerV_0-1675925246402.png

 

Output after run:

 

ShankerV_1-1675925286781.png

 

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @tmorrison 

 

One more tweak to the previous solution.

 

Have tried to eliminate the special characters also if has any along with trailing white spaces issue too.

Input:

ShankerV_0-1675925632183.png

 

Output after run:

 

ShankerV_1-1675925664366.png

 

Many thanks

Shanker V

tmorrison
5 - Atom

Thank you so much!

Labels