Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Renaming Entire Column Based on Single Row

NgYingXue
5 - Atom

Looking at renaming/creating and then populating an entire column based on condition fulfilled for any row.

 

What I have: 

NameValue
TomA
SallyB
NickA

 

Basically, I want to create a new column (Condition) where the entire column will be populated with "True" if any of the rows have the value "B", while if all the rows values' are "A", the entire Condition column will be "False"

 

Ideal Output: 

NameValueCondition
TomATrue
SallyBTrue
NickATrue

 

Thanks in advance!

3 REPLIES 3
Thableaus
17 - Castor
17 - Castor

Hi @NgYingXue 

 

There are probably better solutions. But I came up with this one:

 

Renaming.PNG

 

- Add a Formula to assign a single value for all the Rows (I assigned RecordID as 1)

- Summarize tool grouping by Record ID and concatenating all Values

- Use a Formula tool to apply the condition:

IF Contains([Concat_Value], "B") THEN "True"
ELSE "False" ENDIF

- Join the Condition field back to the original dataset

 

WF attached.


Cheers,

Thableaus
17 - Castor
17 - Castor

@NgYingXue 

 

Using append Tool also works:

 

appendsolution.PNG

 

Cheers,

ChrisTX
16 - Nebula
16 - Nebula

Another option using Append Fields

 

Capture.PNG

Labels
Top Solution Authors