Here is the formula:
Code: Select all
{Format("{0:C}", Round(
Fields.PAY.ULTIMATE_PAY_RATE
*
(
Fields.DETACH_STATION == Fields.HOME_STATION ?
Truncate(DateDiff(Fields.END_DATE,Fields.START_DATE).TotalHours) + (DateDiff(Fields.END_DATE,Fields.START_DATE).Minutes / 60.0):
Truncate(DateDiff(Fields.END_DATE,Fields.START_DATE).TotalHours) +2 + (DateDiff(Fields.END_DATE,Fields.START_DATE).Minutes / 60.0)
)
,2)
)}
The data looks similar to below (it is grouped per person):
HOME STATION --- DETACH STATION --- HOURS --- COST
Washington DC ----- New York- --------------- 8 ------------ £100
Washington DC ----- Washington DC -------- 8 ------------ £80
To explain further, each person is paid an hourly rate, this is called the Fields.PAY.ULTIMATE_PAY_RATE which is in the code above. In the data above the hourly rate is £10, but, as happens in the formula above if the home station is different to the detach station then an extra 2 hours is added on. So in the example above the cost of the Washington DC - New York record costs £20 extra. This is captured in the IF statement from the databand but I am having trouble using this IF statement as part of a SUM function in the group header band.
Could somebody please tell me what I can use in the group header band to achieve a total for that group. In the above example the total would be £180.
Thanks,
Ben