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

How to do row by row custom operations like in python/pandas?

Rajko
7 - Meteor

Hi, i am new to alteryx, used to python. 

 

I have some values, very rough sketch below, I want to go from this:

 

Col 0  | Col 1 |Col 2 | Col 3

x        |           |          |         

y        |     1    |          |         

z        |     1    |    2    |         

 

To this:

 

 Col 1 |Col 2 | Col 3

      x   |          |         

     1    |    y    |         

     1    |    2    |    z  

 

In python, I would do a row by row operation, with logic, checking first IF COl1 is empty, then set it Col 1 = Col 0, then nesting if Col 2 is empty, etc. How do you I do this or something similar in Alteryx? Right now only solution I can think of is making new columns with the formula function, but it is a bit annoying because I would have to make a million ANDs for all the existing columns (e.g. I would have to check that Col1, Col2, Col3 and NOT empty and then that Col 4 IS empty :/)... 

 

Thank you!

Rajko

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@Rajko 
Something like this?

0121-Rajko.PNG

Rajko
7 - Meteor

@qiu, that is smart!! Thank you!

 

Just in case I need to do row by row operations in the future, if anyone knows if that sort of operation is possible, similar to how you would do it in pandas/python, I would greatly appreciate it!

 

Thank you!

Rajko

Labels
Top Solution Authors