The difference between the periods should be 0,1,2,3,4 instead of 0,2,4,5,6.
So even though week 42 is 2 weeks apart from week 40, the difference in measurement periods is 1 instead of 2. Do you get what I mean?
The goal is to be able to calculate the differences between the last X number of periods, so Im afraid that wont work right?
Before I used weekdiff to decide on the number of periods --> e.g. 5 weeks. However since we have bi-weekly measurements I need to show the last 5 periods and the difference between those.
So the difference in period can be one week if we measure weekly but two weeks if we measure bi-weekly.
Still not cleat.
Could you clarify your expected result / View with using existing table and number example.
Alright hereby another example:
For this graph i use the average value of the last period which is in de data and I compare this value with the value of the period before (diff. with previous period).
I now calculated last period and previous period with the weekdiff and monthdiff function (if weekdiff =0 then its the last period and if weekdiff = 1 its the period before for example). The user can change if they want to see periods in weeks or months.
However, now we measure bi-weekly, i get no value for the diff with previous period (weekdiff =1 vs weekdiff = 0), because the previous data is from week 35 2018 and not 36 2018. So I have to make sure that it does not look at actual weeks but the previous period in my data or something.
Should look sort of like the right image.
Does this help?
Unfortunately, not yet.
Could you provide the sample workbook which is currently (previously) working with reflecting this statement.
The user can change if they want to see periods in weeks or months.
And are you trying to cover
1. only" bi-week or the
2. period which include combined rule of "bi-weekly" and "weekly"
1. means WW2, WW4, WW6, WW8, WW10
2. means WW4, WW5, WW6 (change) WW8 WW10,