1 Reply Latest reply on Aug 10, 2016 3:49 PM by swaroop.gantela

    Row number by group (e.g. in tsql ROW_NUMBER() OVER (PARTITION BY [Tank] ORDER BY [Date])

    David. Lewis

      Given data such as the following:

          

      BatchIDTankStartDateValue1Value2RN_TankRN_Batch
      11111/1/11121311
      11111/1/11115412
      11111/1/113513
      12311/12/1177821
      123111/12/1192222
      123111/12/1177223
      12311/12/115224
      18861/13/1563311

       

       

      I'd like to make calculated fields (RN_Tank and RN_Batch in the table above), that can give me a unique row number that will start over for each subsequent batch done in a given tank (let's say I have 1500 historical batches that were done in 50 tanks over the past few years ) and different row number will also number the rows WITHIN each batch

      I no longer have a good way to generate this at the database level.  How can I use Tableau's capabilities to achieve this?  Thanks, David Lewis