Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Need help in using multi row formula

Naga
8 - Asteroid

Hello,

 

Need help. I need to count based on the 'field 2' segmentation. Every time when there is a F or G criteria change in field 2 then output should be in the following series. I tried using multi row formula with if condition. However, my requirement not met because of string conversion error.

 

Record NumberField 1Field 2Output
1AF1
2BF2
3CF3
4DF4
5EF5
6AG1
7BG2
8CG3
9DG4
10AG1
11BG2
12CG3
13DG4
14AF1
15BF2
16CF3
17DF4
18EF5
19AG1
20BG2
21CG3
22DG4
5 REPLIES 5
DavidThorpe
Alteryx
Alteryx

Hi @Naga 

 

The following formula should work:

IF [Field 2]!=[Row-1:Field 2] THEN 1 ELSE
[Row-1:New Field] +1 ENDIF

 

See the attached example

 

Thanks!

DavidThorpe
Alteryx
Alteryx

Just noticed your example resets the count when there is an 'A' in Field 1 also, in that case the following formula is appropriate:

 

IF [Field 2]!=[Row-1:Field 2] THEN 1
ELSEIF [Field 1] = 'A' THEN 1
ELSE [Row-1:New Field] +1 ENDIF

Naga
8 - Asteroid

Thanks..it is pretty swift response... 🙂

Naga
8 - Asteroid

Yep...I was about to respond on this. This helps.

 

Also I need  standard segmentation of numbering the rows. Like segment 1st 10 rows 1 to 10 and again loop 1 to 10 for next until end. There is no dependency on the other fields.

DavidThorpe
Alteryx
Alteryx

You can use a regular formula tool for this, using the following:

 

CEIL([Record Number]/10)

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Increment-by-1-Every-15-Rows/td-p/3066...

 

Thanks!

Labels