Start Free Trial

Alteryx Designer Desktop Discussions

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

Understanding of multi row formula tool.

anonymous008_G
8 - Asteroid

Hi Guys -
Can someone please help me how I could create the Flag column using multi row formula tool which will flag records as 1 until Hard value and then flags 0 for rest of the records. I have provided expected output for reference. Along with solution if you could share the article of multi row functionality would be great for future requirement. 

Input:- 

Sector
Total
EMG
Dev
CASH
Dev
Corp HY
EMG
Corp IG
EMG
Hard
DurationDeriv
Dev
Other
EMG
OtherEM
EMG
Sovereign Dev
EMG
Dev
Sovereign EM
EMG

 

Expected Output :- 

SectorFlag
Total1
EMG1
Dev1
CASH1
Dev1
Corp HY1
EMG1
Corp IG1
EMG1
Hard1
DurationDeriv0
Dev0
Other0
EMG0
OtherEM0
EMG0
Sovereign Dev0
EMG0
Dev0
Sovereign EM0
EMG0
4 REPLIES 4
binu_acs
21 - Polaris

@anonymous008_G one way of doing this

image.png

anonymous008_G
8 - Asteroid

@binu_acs - thanks for this, Could you please explain how this formula works? Having said that, how commanded Alteryx to read and flag the data? 

binu_acs
21 - Polaris

@anonymous008_G 

First Condition: isNull([Row-1:Sector])

What it checks:
It tests whether the field [Row-1:Sector] is null (i.e., missing or undefined) in the previous row.
Result:
If true: The formula returns 1.
This might be used as a starting condition, for example, when processing the first row (where there is no previous row) or when the previous row's Sector is missing.
If false: It moves on to the next condition.
Second Condition: [Row-1:Sector] = 'Hard'

What it checks:
It tests if the previous row's Sector is exactly equal to the text "Hard".
Result:
If true: The formula returns 0.
If false: It continues to the next nested IIF.
Third Condition: [Row-1:Sector] <> 'Hard' and [Row-1:Flag] = 1

What it checks:
Here, two conditions are evaluated:
The previous row's Sector is not equal to "Hard" (i.e., it is something else).
The previous row's Flag is equal to 1.
Result:
If both conditions are true: The formula returns 1.
If not (i.e., either the Sector is "Hard" or the Flag is not 1): The formula returns 0.
anonymous008_G
8 - Asteroid

@binu_acs Great thanks for the explaination. It would help in future

Labels
Top Solution Authors