GRID totals

I am working on class project about reports on GPA, I can compute for the total hours and credit hours using GRID total.
But I am wondering how can i compute for GPA, which is the GPA = total_credit / total hours?
I already have the total credits and total hours but I just dont know the next step on computing for GPA

I tried

$average*={creditptq1_sum}/{Units_per_Week_sum}
sc_alert
($average);*

{gpa} = $average;

but i can not see the result, it is Onfooter event,

Can someone help me with this? I just need to compute and display the result in summary together with the total hours and total credit. I attached the images of my report have many records group by name.

Thanks

GPA.png