5 Replies Latest reply on Nov 13, 2018 2:22 AM by Vijay Santhosh Kumar

    Counting the serial numbers

    Vijay Santhosh Kumar

      Hi All,

       

      I am trying to replicate the same thing in tableau that i have done in excel (attached for reference), where

      if A3=A2, then B2+1, else 1 (where B2 is 1). This gives me the desired result.

       

      But when i try to do the same using tableau, i am stuck. Below is the formula i have used.

       

      IF Lookup(ATTR([Serial_Number]), -1) = attr([Serial_Number]) THEN 1+1

      ELSE 1

      END

       

      it returns the value 1 for all and not the continuous counting. Kindly let me know how can i resolve this issue.

       

      Note: Index() would do the same, but i need to use the same for calculation purpose and sorting purpose. So i need to do using calculated field only.

       

      Thanks in Advance

      Vijay