Alteryx Designer Desktop Discussions

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

Assigning values using IF loop in multi row formula

ayadav8
8 - Asteroid

I am using the multi row formula and I want my code to update certain value in some other row if my condition is met.

I am using the below code:

Whenever the condition is met I want the 30th row to be updated with Row+1 value. But it is not working with this formula. What am I missing?

 

IF [Column]="ABC" THEN
     IF [Row-1:Value]<[Row-2:Value] THEN [Row+30:Value] = [Row+1:Value]
     ELSE [Value]

     ENDIF

ELSE
ENDIF

4 REPLIES 4
ayadav8
8 - Asteroid
I have value for my outside else statement too(sorry for not mentioning).
Thats not the problem. The code is running without error but I am not
getting desired result i.e 30th row to be updated with Row+1 value
Kenda
16 - Nebula
16 - Nebula

Hey @ayadav8! You need a value for your outside else statement.

jrgo
14 - Magnetar

Hi @ayadav8,

 


IF [Column]="ABC" THEN
     IF [Row-1:Value]<[Row-2:Value] THEN [Row+30:Value] = [Row+1:Value]
     ELSE [Value]

     ENDIF

ELSE
ENDIF


I think the part I highlighted is the issue. That would simply output BOOL value. It looks like you're trying to have it update the value in row 30 when it's processing row 1. You may need to adjust and instead of having it look 30 rows forward, have it look 30 rows back. You may have to tweak it a bit, but this would be the general idea.

IF [Row-30:Column]="ABC" THEN
     IF [Row-31:Value]<[Row-32:Value] THEN [Row-29:Value]
     ELSE [Value]
     ENDIF
ELSE
ENDIF

Hope this helps!

 

Best,

 

Jimmy

ayadav8
8 - Asteroid

Thanks @jrgo. The logic really helped.  

Labels