I would shift by using an incrementing index on the time series dataset, e.g. mydset"[$offset..$last]". I don't think I would do wrap around the end. To make the lengths equal, you can set the variables, offset and last, to have a specified length that doesn't go beyond the last volume.