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

Best Answer

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    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 Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    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 Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Awesome! Thank you.