1 Reply Latest reply on Mar 5, 2013 2:44 PM by Tracy Rodgers

    Help with Mix aggregate with non aggregate error

    Kenneth Ho

      I try to come up with an automated field that will help me adjust the allocation bar base on the date (timesheet date), however, when I create a calculation field, then I have an error message.  Please let me know what i can do.

       

      It has collect the same value for the month.  For instance, allocation for the month is 10, then each row will show 10.  I am suppose to run a distinct value in Tableau, but i can't find it, hence, i used Max.

       

      Thanks

       

      [Hours allocated]

      if Month([timesheet_date])=1 then ([Total Allocated Hours 1])

      elseif Month([timesheet_date])=2 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])

      elseif Month([timesheet_date])=3 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])+([Total Allocated Hours 1])

      elseif Month([timesheet_date])=4 then ([Total Allocated Hours 1])

      elseif Month([timesheet_date])=5 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])

      elseif Month([timesheet_date])=6 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])+([Total Allocated Hours 1])

      elseif Month([timesheet_date])=7 then ([Total Allocated Hours 1])

      elseif Month([timesheet_date])=8 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])

      elseif Month([timesheet_date])=9 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])+([Total Allocated Hours 1])

      elseif Month([timesheet_date])=10 then ([Total Allocated Hours 1])

      elseif Month([timesheet_date])=11 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])

      elseif Month([timesheet_date])=12 then ([Total Allocated Hours 1])+([Total Allocated Hours 1])+([Total Allocated Hours 1])

      end

       

      [timesheet date] is the actually time field in the database

       

      [Total Allocated Hours 1]

      Max([Total Allocated Hours])

       

      [Total Allocated Hours] = from database.