Alteryx Designer Desktop Discussions

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

Simple Conditional Formula

mattcoleman
8 - Asteroid

This seems like it should be easy to do, but I can't figure it out. I'm trying to identify runs by looking at a field called 'STEP'.

 

I used a Multi-Row tool for 'STEP-1' which looks at the previous step value. When 'STEP-1' = 0 and 'STEP' > 0, it's a new run and I want a new column to start with '1' as the run. The next time the test passes (goes from 0 to a non-zero number), I want run '2' listed, which would be the current value + 1.

 

When I try and reference the Output Column (Step_Test) in the formula tool, it gives me an Unknown Variable error.

 

mattcoleman_0-1633382223284.png

 

12 REPLIES 12
apathetichell
18 - Pollux

Can you post the config screen of your multi-row formula? If you properly create [step_test] there you shouldn't have that problem here...

mattcoleman
8 - Asteroid

I know I've done this before and it always works, not sure why I'm getting the error here. The multi-row tool is set to an Int32, and all of the step values are integers.

 

mattcoleman_1-1633383953668.png

 

 

Qiu
20 - Arcturus
20 - Arcturus

@mattcoleman 
The unknow variable should the column "Step_Test", and you should initial it first.

It seems that you are creating the new coloumn "Step_Test" with the Formula tool but you also using it in the formula.

Add one expresson above this one as below

Qiu_0-1633401982119.png

 

DawnDuong
13 - Pulsar
13 - Pulsar

hi @mattcoleman 

It seems to me like using the "Group by" within the Multi-row formula can solve your problem. 

However i am not 100% able to follow the description of the logic flow. can you share a mock data to show input and expected output? 

Dawn.

mattcoleman
8 - Asteroid

This is a simple example of what I want. Imagine I have the 'Time' and 'Step' columns, and I want to create the 'Run' column that identifies a new run after the step resets from 0 to a non-zero number.

 

mattcoleman_0-1633449439214.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @mattcoleman 

 

Can you provide this data in an excel file. You can solve this using Multi-row formula tool.

mattcoleman
8 - Asteroid

Sure.

atcodedog05
22 - Nova
22 - Nova

Hi @mattcoleman 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1633450583906.png

 

Hope this helps : )

mattcoleman
8 - Asteroid

Thanks @atcodedog05 . I think this method is close, but as you can see above the Run (Expected) does not match the new Run generated column. After Run 2, there are multiple zero steps, which shouldn't increment to step 3 until you see another non-zero value. Your output makes that Run 3 and then Run 3 becomes Run 4.

Labels