3 Replies Latest reply on Oct 10, 2013 12:46 PM by Michelle Hakow

    Turn a date dimension into a sequence

    Michelle Hakow

      In my data, I have timestamps associated with values and episodes. It looks kinda like this:

       

      trial1          10:00 pm                    20

      trial1          10:05 pm                    20

      trial1          10:10 pm                    30

      trial1          10:15 pm                    40

      trial2          5:30 am                      10

      trial2          5:35 am                      15

      trial2          5:40 am                      15

      trial2          5:45 am                      30

       

      The problem is, I don't want timestamps. I want them to be replaced by a rank, partitioned by trial, where 1 is the first timestamp, and 2 is the second, and so on. This will enable me to compare 1s to 1s between trials. So, I want this:

       

      trial1          1                     20

      trial1          2                     20

      trial1          3                     30

      trial1          4                     40

      trial2          1                     10

      trial2          2                     15

      trial2          3                     15

      trial2          4                     30

       

      One approach is to do a custom sql call, and create the dimension I want there. But is there any way to convert a dimension into a sequence like this from within tableau? Even if I can't partition it by trial, if I filtered by trial, could I convert the timestamp into a sequence of times?

       

      I know about the index option, but this creates a measurement and not a dimension. I don't think I can use the output of an index() applied to timestamp as its own dimension, to plot from.