alteryx Community

# Alteryx Designer Desktop Discussions

## Explanation of multi row formula

11 - Bolide

Hi Team,

Hope you are well.

if [Row-1:ctr_key]=null()
then 1
elseif ([value]=[Row+1:value] and [value]=[Row-1:value]) or ([value]=[Row-2:value] and [Row-1:COMPARE]=1)
then 1
elseif [Value]=[Row-1:Value]
then 1
else 0
endif

Thanks for the help.

Sri

6 REPLIES 6
5 - Atom

This formula is checking for certain conditions, If any of these conditions are true for a particular row, it returns 1; otherwise, it returns 0.

Refer to the below explanation:-

1. Check if the Previous Row's "ctr_key" is Null: If the "ctr_key" value in the previous row is null (empty), then return 1.

2. Check for Specific Patterns in Adjacent Rows:

If the value in the current row is the same as the value in the next row AND the same as the value in the previous row, OR
If the value in the current row is the same as the value two rows back AND the "COMPARE" value in the previous row is equal to 1, then return 1.

3. Check if Current Value is the Same as Previous Row's Value: If the value in the current row is the same as the value in the previous row, return 1.
4. If None of the Above Conditions are Met: If none of the conditions mentioned above are met, return 0.

Thanks,

20 - Arcturus
1. if [Row-1:ctr_key]=null() then 1

• If the value in the ctr_key column of the previous row is null, assign 1.
2. elseif ([value]=[Row+1:value] and [value]=[Row-1:value]) or ([value]=[Row-2:value] and [Row-1:COMPARE]=1) then 1

• If the current row's value is equal to both the next row's and the previous row's value, or if the current row's value is equal to the value two rows back and the previous row's COMPARE column is 1, assign 1.
3. elseif [Value]=[Row-1:Value] then 1

• If the current row's Value is equal to the Value in the previous row, assign 1.
4. else 0 endif

• If none of the above conditions are met, assign 0.
11 - Bolide

Perfect Thanks @Aishw1990

11 - Bolide

Perfect Thank you @binuacs

11 - Bolide

@binuacs  is there a learning material or a link to learn about these tools please if you can suggest.

12 - Quasar

https://help.alteryx.com/current/en/designer/tools.html

@sriniprad08  - there is a help page on Alteryx.com for all the tools.  I'd also suggest the example workflow which you can get to by hovering on the tool on the Preparation Tool Ribbon in Designer and hitting the 'Open Example' link

Labels