In the sheet you posted it was variable "x" which had that nested structure.
Now it seems to be q.c. So you would have to write q.c instead of x in both variants.
The point is that the variable you use at the left hand side of the assignment must already have the nested data structure.
You could also turn the calculation into a function, but this probably would not make much sense as you would only use it once.
But here the name of the formal function arguments must not have something to do with the names of the actual arguments you use.

Nonetheless you should be aware that all these routines are not generic utility routines but only work with the very specific data structure you had provided.