1 Reply Latest reply on Dec 27, 2016 11:37 PM by lei.chen.0

    Creating calculated field for YTD by quarter




      I'm new to tableau and I know that there has been a lot of discussions regarding YTD values, but I've still cannot seemed to be able to get the kind of YTD which I wanted.


      I will like to calculate a year to date (Actual YTD) value based on the below logic:

      Quarter Actual = NumOfGoodResponse / NumOfSurveys

      Q1 Actual YTD = Q1 NumOfGoodResponse /  Q1 NumOfSurveys

      Q2 Actual YTD = sum(Q1 + Q2 NumOfGoodResponse ) / sum(Q1 + Q2 NumOfSurveys)

      Q3 Actual YTD = sum(Q1 + Q2 + Q3 NumOfGoodResponse ) / sum(Q1 + Q2 + Q3 NumOfSurveys)

      Q4 Actual YTD = sum(Q1 + Q2 + Q3 + Q4 NumOfGoodResponse ) / sum(Q1 + Q2 + Q3 + Q4 NumOfSurveys)


      I've tried using window_sum but it does not seemed to be able to do dividing of the window summation.



      Appreciate any advice given. Thanks!