3 Replies Latest reply on Nov 14, 2013 7:12 AM by Jonathan Drummey

    Combining row data?

    Jessica Haycraft

      I'm a newbie to Tableau and I want to combine rows where the Participant ID matches. For example, I have:

      Participant IDWeighIn DateWeight

      xyz111

      2/2/2012167
      xyz111

      2/8/2012

      160

      xyz111

      3/14/2013162
      adc1238/5/2012225
      bbx1444/16/2012140
      bbx1446/17/2013140

       

      But I want:

       

      2/2/20122/8/20121628/5/2012nullnull4/16/2012
      Participant IDWeighInDate_1Weight_1WeighInDate_2Weight_2WeighInDate_3Weight_3
      xyz1111671603/14/2013
      adc123225nullnull
      bbx1441406/17/2013140

       

      My data source is a live connection SQL server. I want to be able to join this table with another table that provides demographic data on the Participants, but I don't want to inflate the number of records because of multiple rows of data for some of the participants.

       

      I also want to be able to calculate the DATEDIFF between the latest record for each participant and the earliest.

       

      I've attached a sample extract of my data file. In reality, I have 40k participants.

       

      How do I do this? Do I need to write custom SQL upon connection to the data source?