What @anirudh was referring to is the following...
Change the summary method of the line item -for which you need to obtain the last value in the quarter- from the default SUM to Closing Balance. This way, the value of each Q will be the value of the last week in the quarter.
Now that you have the value you want in each Quarter, you can directly reference it and it will equal the value of the last week in the quarter. Anaplan has native functions to reference Quarter values, but we don’t have a native function to reference Week x of the year.
assumption for that solution to work are: 1. You should be using Native Anaplan Time.
2. Module is dimensioned by weeks
Einas "Give a Man a Fish, and You Feed Him for a Day. Teach a Man To Fish, and You Feed Him for a Lifetime"