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

Alteryx Designer Desktop Discussions

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

Renaming a string field after "Summarize"

jcsoh
7 - Meteor

Hi,

 

If I would like to rename a field in a data that had been "summarized", how should I do it? I list the tables below as example. I would like the final output to be like Table C.

 

Table A (before Summarize was applied):

Company NameTotal
Company A100

Company B

200
Company C300
Company D400

 

Table B (after Summarize was applied):

Company NameTotal
Company A1000

 

Table C (after Summarize was applied):

Company NameTotal
John Deere1000

 

Cheers,

J

6 REPLIES 6
JosephSerpis
17 - Castor
17 - Castor

Hi @jcsoh I mocked a couple of ways you could do this. Let me know what you think?

jcsoh
7 - Meteor

Thanks once again, @JosephSerpis. One of the formula (Replace) works for me. The IF "Company A" THEN "John Deere" ELSE [Company Name] ENDIF can't seem to work.


What if I have this scenario (not related to Summarize) where I want to replace "Company C" from Table A to "Company John" in Table B?

Table A

Company NameTotal
Company A100

Company B

200
Company C300
Company D400

 

Table B

Company NameTotal
Company A100

Company B

200
John Deere300
Company D400

 

JosephSerpis
17 - Castor
17 - Castor

Hi @jcsoh one way is to Join by position however this relies on both data inputs being in the right order for your use case. Or you could Join by total as in your example the total match from the two data inputs. 

jcsoh
7 - Meteor

Hi @JosephSerpis, sorry think I wasn't clear. What I wanted was a rename of a field from a single input data. See example below of renaming the field from "Company C" to "John Deere" (see example below ).

 

I tried to use IF "Company C" THEN "John Deere" ELSE [Company Name] ENDIF, but I can't seem change it to "John Deere".

 

Before:

Company NameTotal
Company A100

Company B

200

Company C

300
Company D400

 

After:

Company NameTotal
Company A100

Company B

200

John Deere

300
Company D400
JosephSerpis
17 - Castor
17 - Castor

Hi @jcsoh the correct syntax would be IF [Company Name] = "Company C" THEN "John Deere" ELSE [Company Name] ENDIF you can also use IF Contains([Company Name], "Company C") THEN "John Deere" ELSE [Company Name] ENDIF .

jcsoh
7 - Meteor

Oh yes, they worked. I understand now too. Thanks a lot @JosephSerpis!

Labels