5 Replies Latest reply on Apr 30, 2018 8:11 AM by Okechukwu Ossai

    How to select a range from a pivoted table by date?

    Victor S



      I'm pretty new to Tableau and working with pivoted data for the first time. I have pivoted table with customer data which looks somewhat like this:


      IDActionDateFields.... (Age, Gender, etc.)


      To look how the customers developed over time I used three calculated fields which look like this:


      [Customers enrolled] = IF [Action] = "Enrolled" THEN 1 ELSE 0 END

      [Customers cancelled] = IF [Action] = "Cancelled" THEN 1 ELSE 0 END

      [Cutomer difference] = RUNNING_SUM(SUM([Customers enrolled])) - RUNNING_SUM(SUM([Customers cancelled]))


      This works great so far and I was able to do a lot of visualizations.


      Now i want to look at the customers who are currently (still) enrolled and analyze them further. How would I go about doing that?

      I tried filtering [Cutomer difference] but that doesn't work bescause it's a running sum. I selected the last month in my view and tried to create a set but in that case most customers where missing.


      Basically what I want Tableau to do is: Take all enrolled data rows where the corresponding cancelled row lies after date X or doesn't exist. And have that as a measured or calculated field for further use.

      Is there any way to do that?


      Thank you very much for the help.