5 Replies Latest reply on Oct 12, 2017 3:30 PM by Jim Dehner

    Reordering widgets to go 0-n

    jessica.youngberg

      I am using Tableau Server 10.3.1, with a data source connecting to a postgres database. If I had desktop access and an Excel version of this data source, I'd fix my issue very quickly. Surely there's a workaround for me? I've attached a twb.

       

      I have a large dataset where widgets are organized into states and then into an order that is specific to that state. Widgets can appear in multiple states, and the relative order of A vs B is dependent on that state. The states have different numbers of widgets, anywhere from 400 to more than 900.

       

      The thing is, the order jumps--1001, 1002, 2001, 2003--and I want it to be ordered in a continuous fashion. I want it to start at 1 and then go up to however many widgets there are.

       

      StateCategoryWidget
      OrderDesired Orderfixed %age
      AK1a100112
      AK1b100222.001998
      AK2d200133.998
      AK2e200244
      CA1a100112
      CA1c100222.001998
      CA2e200133.998
      CA2f200244

       

      I've gotten this far, thanks to help with LOD calcs in a previous question: ([Order]/{Fixed [State]: max([Order])})*{Fixed [State]:countd([Widget])}

      That turns the order into a percentage of the maximum order for that state, and then sets the maximum value as that state's n.

       

      This has two drawbacks:
      1. My scatterplot still rounds to the nearest whole number, so I have clusters when I want a smooth line of points.

       

      2. It doesn't start at 1. (0 would also work.) This isn't a dealbreaker, but will end up looking funny when comparing across states that have different ns.

       

      What do you recommend? Am I even on the right track?

       

      Thanks so much!