How can I add a unique row number for every row in a Card (table)?


I am building a card that will have multiple rows.  For this example, the card will have 100 rows.  I would like to add a column that has a 'counter' 1-100 for each row.  What is the best way to add this to the card?






  • Valiant

    To this via a SQL transform:


    1st determine what you are going to order your card by to get the row number (rank). I'll use 'Volume' for my example.


    You can do the following to your current dataset to add a row number (rank) column. 

    ,@rank:= @rank + 1 AS `Rank`
    FROM `dataset` AS a, (SELECT @rank:=0) b
    ORDER BY `Volume` desc

    Then at the card level, make sure to sort by your new rank column and then add it to your table.


    Hope that helps,


    **Please mark "Accept as Solution" if this post solves your problem
    **Say "Thanks" by clicking the "heart" in the post that helped you.

  • or... via ETL



    “There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
This discussion has been closed.