4 Replies Latest reply on May 23, 2013 2:15 PM by Chris Tsui

    Compare Min/Max of the same date field?

    Chris Tsui

      Hi There,

       

      This seems like a fairly easy (Logically) issue, but I can't seem to implement it in Tableau...

       

      My Data looks similar to (But simplified):

       

      PackageIDCategoryOrder Date
      1AppointmentDec 1, 2012
      1ServiceDec 8, 2012
      1ServiceDec 20, 2012
      2

      Appointment

      Nov 11, 2012
      2ServiceNov 9, 2012

       

      Because Order date is the same field regardless of category, what I'm trying to figure out is if I can do a comparison of each date per category.

       

      Primarily I'd like to determine how many Packages are schedulign an appointment before service.  So I'd like to pretty much do a date diff for the Max Appointment time and the Min Service time.  Anc count how many negative numbers there are.

       

      I'm not entirely sure how to do this  I can get the min/max for each category, but I'm not sure how to calculate the differences because they are the same field and a datediff(Min([Order Date]), Max[Order Date[)) doesn't seem to work given I can't specify which category/package it is?

       

      Sadly I've been working with WEBI a lot lately so I keep thinking if only there were some sort of function like Date Diff (Max(Order Date) Where Category = "Appointment") , Min(Order Date) Where Category = "Service))

       

      Any help would be greatly appreciated!

       

      Thanks,

      Chris