4 Replies Latest reply: Mar 5, 2018 9:08 AM by beck bakytbek RSS

    Flag for StartDate and EndDate

    beck bakytbek

      Hi Folks

       

      i got a question, my table does look like:

       

      Project     ReportDate     EndDate      Difference in Months

      A            31.03.2018     30.06.2021          39 Months

       

      i am using this procedure:

       

      test:

      LOAD *,

      $(MonthDiff(Start, EndDate)) AS MonthsDifference;

      load *,

      MonthStart(ReportDate-1, 1) as Start

      inline [

      Projekt, ReportDate, EndDate

      A, 31.03.2018, 30.06.2021

       

       

      The output does look like:

       

      Project    Start                         End                         Month

      A             01.04.2018               31.12.2018                  9

      A             01.01.2019               31.12.2019                 12

      A             01.01.2020               31.12.2020                 12

       

      i calculated the Monthdifferences and it does work great, regarding this issue, i have a question, how can i add the flags to EndDate and StartDate, for instance:

       

      31.12.2017 = Ending_OldYear

      31.01.2018 = Beginning_NewYear

       

      31.12.2018 = Ending_OldYear

      31.01.2019 = Beginning_NewYear

       

      Flag = 1 for Ending_OldYear, 2 = for Beginning_NewYear

       

      Does anybody have any idea?

       

      Thanks a lot

      Beck