Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Day wise comparison with previous year

Hi guys i am facing a problem, i want to comapare week-days with previous year i.e Eg: sunday to a sunday and monday to a monday and assign the comparable days as 'X' and non compoarable days as 'Y'. How can i comapare it. is there any solution Please help me with it.               

4 Replies

  • vminvsky's avatar
    vminvsky
    Frequent Visitor

    What I would do is take the WEEKDAY(FIRSTDATE(DATE columns)) for each of the date columns you have. Then I would subtract these two values, for the sake of example let's call it X. This X value will be the transformation constant we'll use to adjust the day of year column. Then I'd create a new column called index in the older table such that INDEX = DAYNUM(DATE (older columns)) - X. Then connect this column and your other day of year column. I'd connect them both to a dates table. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Sry Anonymous  i could not able to access the link. i could not open it.

      • tex628's avatar
        tex628
        Icon for Community Champion rankCommunity Champion

        Create a key in your datetable using YEAR(), WEEK() & WEEKDAY()

        Then match 18-49-1 with 19-49-1 etc.