Forum Discussion

ton-v's avatar
ton-v
Frequent Visitor
6 years ago
Solved

MTD based on week number problems

Hello everyone,   juste before i stard, i searched before i post this and i could not find the same problem as me.   i am comparing each week the evolution of the turnover, and then i compare it ...
  • ton-v's avatar
    ton-v
    6 years ago

    Hello,

     

    No it doesn't work ufortunately.

     

    Hopefully i resolved my problems by myself Here is the solution if people have the same issue.

     

    (1)calculate the first day of the week using the function "FIRSTDATE"

     

    (2)Then you calcultate the last day of the week  (1) + 6 

     

    (3) You use a if function to now if the month number of 1 and 2 are equal, if month are equal you can use the calculated lastday (2), if not you have to find the lastday of month (1) with this formula DATE(YEAR((1));MONTH((1)+1;1)-1.

     

    Finally you calculate the expression and for the filter you take datesbetween( firstdate(1);Lastdate(3)