Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Multirow formula issue

Highlighted
8 - 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

Highlighted
Alteryx Certified Partner
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,

16 - Nebula
16 - Nebula

@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
Highlighted
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