I am working on a little project for work. I have my pivot table set up and what i'd like to do is save the value of my calculation so the total is an easier reference.

LineNum Part WK 1 WK2 WK3 WK4 WK5
A 448
B 16
C 16
A 50
B 288
C 48

what I currently have to sum my rows into pivot format is

sum(if(actualshipping.wk1>0,actualshipping.wk1,0)) AS "Total For Week 1",

what i want is something like below but when i use it i get NULL

@wk1:=sum(if(actualshipping.wk1>0,actualshipping.w k1,0)) AS "Total For Week 1",

is there any way to store these references as variable type declarations?