Your chart already shows weekly timeframe so you do not need timeframe functions as time timeframe functions work from shorter interval to longer interval but not vice versa.
The code is incorrect.
You do not need timeframe code to call weekly interval if your chart shows weekly already. Simply set Aux aggregation mode to Sum in File - Database settings - Intraday settings.
Since your post is not rock solid clear and if you mean to say that you want to call aggregated Aux data of weekly interval in daily chart (despite your chart does show weekly) then read here
So
tmfrm = inWeekly;
Aux2Weekly = TimeFrameCompress(Aux2, tmfrm, compressVolume);// cumulative Aux data
TE = TimeFrameExpand(Aux2Weekly, tmfrm, expandLast);
Ah sorry for the confussion. The code is correct, aux2 is the value that I worked on.
I show you the weekly chart just to make clear of the value, but I work primarily on daily timeframe, so I dont want to keep changing timeframe just to access the weekly data.