community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Multirow formula issue

Asteroid

Hi! I have the following problem:

I need to create ID for positions like in the following example:

PositionID
A1
A1
A1
B2
B2
C3

 

I tried to use multirow formula 

IF [Row-1:Position]=[Position] THEN [Counter_id] = [Row-1:Counter_id] ELSE [Counter_id] = [Row-1:Counter_id] + 1 ENDIF

 

Where column [Counter_id] is initially a column with 1 in every row. But result column shows wrong answer - there are only 0 and -1 values

 

Thanks for any help

Alteryx Certified Partner

Hi @Nastya 

Use Tile Tool with Unique Value method:

 

Tile.PNG

 

Unique Value being your Position field.

 

The Tile_Num field would be your ID now.

 

Cheers,

@Nastya  Very close! I would try something like this:

IF [Row-1:Position]=[Position] THEN [Row-1:Counter_id] ELSE [Row-1:Counter_id] + 1 ENDIF
Alteryx Partner

Hi Nastya, 

You can create a column whose value is 1 and then create the ID column by creating a running total of the same column and grouping by the "Position" column . 

 

Thanks, 

Ankit.

Labels