5 Replies Latest reply on Jan 31, 2013 6:05 AM by Shawn Wallwork

    Reshaping (using add-on) and following doublecounting complications using sum()

    Marc Tollin

      This is a question about reshaping data.

       

      Let's say my data comes in like this, and I want it all to be represented the same view.

       

       

      Day
      Spend ($)Purchases of Apples
      Purchases of Oranges
      Monday514
      Tuesday723
      Wednesday332
      Thursday241

       

      Okay, this is crosstab data, so my options in Tableau will be limited unless I fully normalize using Excel Add-On. I do this and now have:

       

       

      Day
      Spend ($)
      FruitHeader 4
      Monday5Apple1
      Monday5Orange4
      Tuesday7Apple2
      Tuesday7Orange3
      Wednesday3Apple3
      Wednesday3Orange2
      Thursday2Apple4
      Thursday2Orange1

       

      So now when I load THIS data set into tableau...and I want to look at spend on weekly/monthly basis...If I use sum(), I'm going to overcount. Do I need to create a new calculated field that doesn't double count everything? If so, any advice on what formula to write? Some sort of funny avg?

       

       

      Would it be easier if, after reshaping, I took my original DAY AND SPEND table and BLEND  (given day is a relationship) it with the reshaped Fruit/purchases information?

       

      Thanks,

      Marc