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

      Hi,

       

      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.)
      1Enrolled01.01.2017...
      1Cancelled01.01.2018...
      2Enrolled01.01.2017...
      3Enrolled01.01.2017...
      3Cancelled02.01.2017...

       

      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.