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

Alteryx Designer Desktop Discussions

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

Changing the values of multiple columns

srea541
8 - Asteroid

Hi

I'm trying to change values in multiple columns based on the value of another column.

 

Column Q1 holds either 1,2 or 3

Q1_1, Q1_2, Q1_3 are all blank to start.

 

I have tried multi-field formula:

if [Q1] = 1 then [Q1_1] = 1

elseif [Q1] = 2 then [Q1_2] = 1

elseif [Q1] = 3 then [Q1_3] = 1

else NULL()

 

...and it just returns zeros. Unfortunately there's quite a few of these so doing them in individual formula tools would take forever.

What would be the best way to do this?

 

Thanks!

7 REPLIES 7
grazitti_sapna
17 - Castor

Hi @srea541, could you please provide the input and output required?

Sapna Gupta
srea541
8 - Asteroid

Hi @grazitti_sapna,

The table starts like this:

srea541_1-1652449336313.png

 

I am trying to achieve this output:

srea541_0-1652449303222.png

 

Thanks!

 

grazitti_sapna
17 - Castor

@srea541  Thanks for the quick response. Here is my solution to your problem.

grazitti_sapna_0-1652449799751.png

 

I hope this helps!

 

Thanks!

Sapna Gupta
srea541
8 - Asteroid

Thank you for this @grazitti_sapna! That works as expected!

 

How would this work if i wanted to do it for multiple questions e.g. Question 3 as well?:

srea541_0-1652450777940.png

 

Q3 would follow the same logic as Q1 did. I will ultimately end up with about 10 questions needing this done to them!

 

Thanks!

grazitti_sapna
17 - Castor

@srea541 , yes it would.

grazitti_sapna_0-1652451009182.png

 

Thanks!

Sapna Gupta
srea541
8 - Asteroid

Thank you @grazitti_sapna, I have marked your reply as solution :)

grazitti_sapna
17 - Castor

@srea541 Thank you so much. Much appreciated!

Sapna Gupta
Labels
Top Solution Authors