I am trying to use the following statement of a Data Field in the Results of a GI.
=iif([PrevPDO.EffectiveDate] >= '2023/06/24',[EmployeePDOHours.PDOHours]-[PrevPDO.HoursUsed],[EmployeePDOHours.PDOHours]-SUM(Iif([PMTask.TaskCD] = '10',[PMTimeActivity.TimeSpent]/60,0.00)) + [EmployeePDOHours.HoursUsed] )
When I run the GI it errors out with a GROUP BY clause error.
However, when I take out the SUM(Iif([PMTask.TaskCD] = '10',[PMTimeActivity.TimeSpent]/60,0.00)), I can run the GI without an error, but it does not calculate what I want as I need to include the SUM of the time activity based on that Task ID. I can put that SUM(Iif(iPMTask.TaskCD] = '10',0PMTimeActivity.TimeSpent]/60,0.00)) into another GI Results row and it returns the correct value, so it IS a correct forumla. It simply does not want to work inside of that other IIF statement. Is there something I can do to make this work?
(If there is even a way to create a GI variable with that SUM value and then referenced in the IIF statement that would be fine also).
Thank you,