3 Replies Latest reply on Jul 18, 2012 11:46 PM by Chuan Huang

    Need a list of dates between two dates, do I have to change the data source?

    Chuan Huang

      Hi Tableau expert,

       

      The data source I'm using is a spreadsheet that has been updated by other teams. We had some script to upload this spreadsheet to MySQL database. The problem is the format in this spreadsheet is not what I need. The spreadsheet has "start date" and "end date" per row entry but I need a list of days between both "start date" and "end date".

       

      Here is spreadsheet format they provide (they just add many rows with the same format on daily basis, for simplicity, I only listed one row):

       

       

      startdateenddatepartnerpartneridcountrysizequantity
      7/1/127/3/12abc.comae051USLarge3000

       

       

      What I want to import to Tableau is like this, because I need to sum up the quantities per date per country and per size in Tableau. The initial data source format with only start and end dates doesn't allow us to show daily measures.

       

      datepartnerpartneridcountrysizequantity
      7/1/12abc.comae051USLarge3000
      7/2/12abc.comae052USLarge3000
      7/3/12abc.comae053USLarge3000

       

       

      It looks like I need some MySQL User defined functions (UDF) to return all days between "start date" and "end date" and then using this transformed result join with another table on the data source.

       

      My question is whether or not we can apply UDF in Tableau custom SQL for MySQL connection? Is there any Tableau workaround without using complicated UDF to change data source? Thank you!