Adding row numbers to a table with a Beast Mode?

Reply
Highlighted
Yellow Belt

Adding row numbers to a table with a Beast Mode?

Is there a way to add row numbers to a table with a Beast Mode? So there would be a column to the left of Date with a 1. for 2020-09-01, a 2. for 2020-09-08, etc?

 

Screen Shot 2020-10-15 at 3.20.00 PM.png


Accepted Solutions
Highlighted
Red Belt

Hi @Joe_M 

You can utilize a windowing function (if you don't have it enabled in your instance, talk to your CSM to get the feature switched on) within a beast mode.

 

SUM(SUM(1)) OVER (ORDER BY `Date`)

 

This is calculating the row number based on the `Date` field, if you need to calculate it based on another field change `Date` in the beast mode. 



**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**

View solution in original post


All Replies
Highlighted
Red Belt

Hi @Joe_M 

You can utilize a windowing function (if you don't have it enabled in your instance, talk to your CSM to get the feature switched on) within a beast mode.

 

SUM(SUM(1)) OVER (ORDER BY `Date`)

 

This is calculating the row number based on the `Date` field, if you need to calculate it based on another field change `Date` in the beast mode. 



**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**

View solution in original post

Highlighted
Yellow Belt

Awesome! Thank you.

Announcements
Domopalooza 2021 Call for Presenters: We want to hear how Domo is revolutionizing the way you do business!

Click here to submit your story.