Rolling Weeks


I need to define the following logic.
1. I have to enter a #. of months and an end date. Depending on which I have a weekly trend chart which has to show data for .. let's say a product A.
2. The weekly trend has a formula for the Y axis values.. [((Count no. of units sold) / (Region Rate defined)) / Fiscal Week # till 13. After 13th week denominator remains static @ 13]
The window (# of months) can be for any number of weeks. In that the first 13 weeks will start from 1 going till 13 and then be static at 13 from there on for the entire window

For the end date and the # of months; I have created separate Property Controls.

Problem is how to achieve the second point. I need dire help on that as Rank(), DenseRank() dont seem to work.




(1) Answer