Alteryx Designer Desktop Discussions

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

Replace values in multiple columns in one go

Deepvijay
Météoroïde

Hi All,

 

I've a situation like in the snapshot. All I need is to replace "True" "False" with 1 & 0 (1 is True of course). Is there any way through which I can do this in one go rather than going to each column for replacement?

 

Any hope?

Thanks,

 

Deepvijay_0-1607097815330.png

 

4 RÉPONSES 4
Greg_Murray
Quasar

Hi @Deepvijay,

 

You're looking for the multifield formula tool.

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Multi-Field-Formula/ta... 

 

Hope that helps,

 

Greg

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @Deepvijay,

 

As @Greg_Murray said you could use a multi-field formula to apply a formula to more than one column at a time.

 

Input:

 

Jonathan-Sherman_1-1607099457294.png

 

 

In your multi-field formula tool you'll want to select the fields to convert, select change output type checkbox to convert the field to a byte (or numeric data type) and create your expression. Depending on whether your fields (True/False) are stored as boolean or strings you'll need to use the appropriate formula:

 

Multi-Field formula tool configuration (using expression for strings):

Jonathan-Sherman_0-1607099439358.png

 

 

Bool data type expression:

 

IF [_CurrentField_] = 1
THEN 1
ELSE 0
ENDIF

 

 

String data type expression:

 

IF ToString([_CurrentField_]) = 'True'
THEN 1
ELSE 0
ENDIF

 

 

Output:

Jonathan-Sherman_0-1607098992106.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

 

Deepvijay
Météoroïde

Thank you for your help. 🙂

atcodedog05
22 - Nova
22 - Nova

Hi @Deepvijay 

 

Here is a short interactive lesson which will give you an understanding of Multi-Filed formula tool.

https://community.alteryx.com/t5/Interactive-Lessons/Multi-Field-Formulas/ta-p/424422#done

 

Hope this helps 🙂

 

Cheers and Happy Analyzing 😀

Étiquettes