We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How do I create a column with each two rows lines numbered 1,2?

PDempsey
7 - Meteor

I need to add a column to my workflow (accounting related) which reads as follows:

 

1

2

1

2

1

2

1

2

and so on

 

I have tried using:

IF ([ROW-1] % 2 = 0 THEN 2 ELSE 1 ENDIF) and other versions of this but it seems my alteryx won't execute any expression containing [Row-1] or [RowID] etc.

 

Any help greatly appreciated , thanks in advance

2 REPLIES 2
davidskaife
14 - Magnetar

Hi @PDempsey 

 

Try this, create the column you want to have the numbering on and fill it with 1, then use the Multi-row Formula tool with this expression:

 

 

IF [Row-1:Accounting] = 1 
then 2 
else 1 
endif

 

 

DavidSkaife_0-1685114514626.png

 

PDempsey
7 - Meteor

Perfect, thank you! So simple in the end :)

Labels
Top Solution Authors