3 Replies Latest reply on Oct 3, 2016 12:23 PM by Yuriy Fal

    Complex table calculation

    florin fm

      Hi, I need help with a complex table calculation. I have a table like this:

       

       

      Iddayvalue
      100.00%
      2-20.00%
      340.00%
      4-375.00%
      450.00%
      5133.33%
      550.00%
      60100.00%
      7950.00%

       

       

      For each id, I have a record which tells when (what day) the value changes. 0 is reference day, -1 is the day before, 1 is the day after. The values are between 100%-0% and the values can only to decrease. For example, for id 1 there is only 1 record, in the day 0 the value is 0.00%, meaning that on the days before (-1, -2, - 3 etc) the value was 100%, and on the days after (1,2,3 etc) it will be 0.00%. For id 4, there are two records, day -3 value is 75.00% and day 5 value is 0.00% (meaning that  on days<-3 value is 100%, on days -3 to 4, value is 75.00% and on days>=5 value is 0.00%.

       

      I need to calculate in Tableau the Average value for all id, so I need the values for each id in all days, the result should look like this:

       

       

      dayaverage value
      -396.4%
      -282.1%
      067.9%
      158.3%
      444.0%
      528.6%
      921.4%

       

      Please help me, if it is possible to do this in Tableau, Thank you !