Hello dear Alteryx Community members,
I'd like to solve something using the Formula tool. For this I'm using only 3 columns of data:
I've got a list of date_actual, vehicle_id's, and a boolean regarding whether or not a car is stored (in_storage_on_compound)
I need the formula tool (or any other tool that gets the job done) to tell me if a car that is in_storage_on_compound on a given day, was not in_storage_on_compound a day before.
Ex: See row 28. This car is has in_storage_on_compound = 1 on 2021-06-30. And the day before in_storage_on_compound = 0 (2021-06-29)
I need the formula tool to add another column, let's call it storage_inflow, and for line 29 it should give the output of "True" or 1.
Can anyone help me with this?
With kind regards,
Lazzanova (See attachment of example of data)
Solved! Go to Solution.
Hi @Lazzanova ,
You can do it using a Multi-Row Formula checking both previous row value and current row value.
Workflow attached ! Tell me if it suits your need or not !
Hi @Lazzanova
You can use formula like below in multi-row formula tool.
String datatype:
IF [Row-1:in_storage_on_compound]="0" and [in_storage_on_compound]="1" THEN "1" ELSE "0" ENDIF
or
Numeric datatype:
IF [Row-1:in_storage_on_compound]=0 and [in_storage_on_compound]=1 THEN 1 ELSE 0 ENDIF
Workflow:
Hope this helps : )
Thanks Jean. That really helped me solve my problem!
You are welcome @Lazzanova ! @atcodedog05 's solution also is good and he offered the numeric one !
Thanks @Jean-Balteryx , You did solve the actual problem and was faster 🙂👍
I copied the data to remove input file and ended up with properly datatyped data 😅
And later I had to update the response.
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |