Alteryx Designer Desktop Discussions

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

How to use replace

ArijitRoy
8 - Asteroid

Hello Friends,

 

I have column header names as below. Looking for header names should be like under  "Need".

 

Current HeaderNeed
2022_12___Sum_Credit_Amount2022-12 - Sum Credit Amount
2022_12___Sum_Debit_Amount2022-12 - Sum Debit Amount
2022_12___Sum_SLA_Amount2022-12 - Sum SLA Amount
13 REPLIES 13
binuacs
21 - Polaris

@ArijitRoy Use the ReplaceChar() function 

 

ReplaceChar([Current Header],’_’,’-‘)

DavidSkaife
13 - Pulsar

Hi @ArijitRoy 

 

Here is a way of doing it without using the Replace function, but with Dynamic Rename tool so you don't have to write multiple Replace statements to cover all outcomes:

 

DavidSkaife_0-1685098038329.png

Define your headers in a Text Input tool like so:

 

DavidSkaife_1-1685098081708.png

 

Configure the Dynamic Rename tool like so:

 

DavidSkaife_2-1685098103397.png

 

 

ArijitRoy
8 - Asteroid

Hi @DavidSkaife,

 

According to the example, I have shared the Year and Month as 2022_12, I have in continuation as 2023_01, 2023_02, 2023_03 & 2023_04. Is this tool work?

DavidSkaife
13 - Pulsar

Hi @ArijitRoy 

 

As long as you put them in the same order they are in the original headers, the tool should work

ArijitRoy
8 - Asteroid

Hi @DavidSkaife

 

It is not working. Below is the screenshot of the data I have.

 

ArijitRoy_0-1685106572794.png

 

DavidSkaife
13 - Pulsar

Hi @ArijitRoy 

 

what output are you getting? Can you share your workflow at all?

ArijitRoy
8 - Asteroid

Hi @DavidSkaife,

 

Attached an example of the tool with less data. Currently we have data till April. I want future months also get changed accordingly.

 

Current status Looking for
2022_12___Sum_Credit_Amount2022-12 - Sum Credit Amount
2022_12___Sum_Debit_Amount2022-12 - Sum Debit Amount
2022_12___Sum_SLA_Amount2022-12 - Sum SLA Amount
2023_01___Sum_Credit_Amount2023-01 - Sum Credit Amount
2023_01___Sum_Debit_Amount2023-01 - Sum Debit Amount
2023_01___Sum_SLA_Amount2023-01 - Sum SLA Amount
2023_02___Sum_Credit_Amount2023-02 - Sum Credit Amount
2023_02___Sum_Debit_Amount2023-02 - Sum Debit Amount
2023_02___Sum_SLA_Amount2023-02 - Sum SLA Amount
2023_03___Sum_Credit_Amount2023-03 - Sum Credit Amount
2023_03___Sum_Debit_Amount2023-03 - Sum Debit Amount
2023_03___Sum_SLA_Amount2023-03 - Sum SLA Amount

 

ArijitRoy
8 - Asteroid

Keep the first column header (Invoice Reference Number) as it is.

DavidSkaife
13 - Pulsar

Hi @ArijitRoy 

 

I've attached your workflow with it working; i've done it slightly differently in that the mapping text input has the original and the replacement field names, that way it doesn't matter what order you have them in

 

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels