Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Multi-row formula if statement

jenner85
8 - Asteroid

Hi - 

I need to do the following - if the row above in the File name is different, I need to populate something into another column. 

 

Input:

 

File NameCPC
1-Feb 
1-FebBC
1-Feb 
2-Feb 
2-FebAH
2-Feb 
3-Feb 
3-FebAA
3-Feb 

 

Output:

 

File NameCPC
1-Feb 
1-FebBC
1-Feb 
2-FebALL
2-FebAH
2-Feb 
3-FebALL
3-FebAA
3-Feb 

 

 

Basically as soon as there is a change in filename, I need the first row to say ALL in the CPC column. 

 

thanks!

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

A multi-row formula tool updating the CPC column with an expression of:

IIF([Row-1:File Name]!=[File Name],"ALL",[CPC])

should work.

 

You will need to make sure the CPC column is of a type which can fit ALL in (hence using a SELECT tool in the example)

 

vizAlter
12 - Quasar

Hi @jenner85  — Try this solution:

 

vizAlter_0-1600895909813.png

 

Please mark it "Solved" or "Solved" with a Like if it resolved your query. This will help other users find the same answer/resolution.  Thank you.

Labels