Alteryx Designer Desktop Discussions

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

Increment by 1 Every 15 Rows

rjanezic
7 - Meteor

Hello,

 

So basically I have data that I need to group together, but have nothing that would explicitly group it together other than the Row Number. I need to group together every 15 rows and increment it by one. I've included an image below of what I'm looking to do. Any help would be greatly appreciated. Thank You

 

6 REPLIES 6
Claje
14 - Magnetar

Hi,


Try the following formula:

FLOOR(([Record Number]-1)/15)+1


This will take the record number (minus 1 because we want the 15th record to still be ID 1), and divide it by 15.  It will then find the floor, which is the nearest integer (rounding down).

Then we add one to this so that it starts at 1 instead of zero.

 

BenMoss
ACE Emeritus
ACE Emeritus
You can use the following formula if you have a row number already...

CEIL([RowNumberField]/15)

Basically devide the row number by 15 and then round to the nearest whole number.

Ben
Claje
14 - Magnetar

Just wanted to reply and say that @BenMoss has the more elegant formula.  CEIL() is definitely more appropriate than FLOOR() and avoids some of the addition/subtraction I was using.

BenMoss
ACE Emeritus
ACE Emeritus
I used to do floor and then was client side and they taught me a more efficient way!
rjanezic
7 - Meteor

Oh wow that's really interesting. Definitely wouldn't have thought of that. Thank You!

rjanezic
7 - Meteor

Thank You for the help! Both solutions work well

Labels