Hello all,
I am new to Alteryx and for my class I am trying to delete the rows that decreases in value twice and have 0 clue on how to do it properly.
For example if my heart rate is at 66 - 67 on hr1, and on hr2 it drops to 55-56, and on hr3 it drops once again at 52-53 THEN I would have to get rid of this row.... I have 0 clue on how to make this happen. Please help.
Solved! Go to Solution.
Hi @wfqm8
The tool that gives you the ability to look at rows sequentially before and after the current row in formulas in the Multi-Row Formula tool.
https://help.alteryx.com/current/designer/multi-row-formula-tool
In this case, if your field is [Heart_Rate] and you want to create a flag to remove rows where the two preceding rows are incrementally greater in value, here's the expression:
IF ([Heart_Rate]<[Row-1:Heart_Rate] AND [Row-1:Heart_Rate]<[Row-2:Heart_Rate]) THEN 1
ELSE 0 ENDIF
Then a Filter tool can remove where this value is 1. You can also do this in two steps if that helps introduce you to the operation of the Multi Row Formula tool by first creating a [Diff] field then looking for observations where the last two [Diff] values are decreasing. I've attached a workflow that shows an example of both. Check it out and let me know if that's what you're looking for.
EDIT: If your values are stored in sequential fields on the same row/record, then I recommend transposing those fields and then applying the method I outlined above.
Hi @wfqm8
As a leader in the Alteryx Community, I have the ability to identify & mark accepted solutions on behalf of community members - and recently did so on this thread. If you have any questions or concerns with the solution(s) I selected please let me know by replying to this post.
Learn more about Accepted Solutions here.
Thank you!
Dan