2 Replies Latest reply: May 31, 2018 4:59 AM by nicolas sinquin RSS

    Touble with AddMonth in set analysis

    nicolas sinquin

      hye all,

       

      I'm in trouble using addmonth in a set analysis.

      In Load :

      Load  Date(Date#(DAT_CONSO_COJ,'YYYYMMDD'),'DD/MM/YYYY') as DAT_CONSO_CONS_NEW,

      DAT_CONSO_COJ,

              IDF,

              Code;

      BASE_TEST:

      LOAD *  INLINE [

      DAT_CONSO_COJ, IDF, Code

      20180502,1,A

      20180502,11,A

      20180503,2,A

      20180503,12,A

      20180504,3,A

      20180505,4,J

      20180601,1,A

      20180601,21,A

      20180601,11,A

      20180602,2,A

      20180603,3,A

      20180604,5,A

      20170502,1,J

      20170503,2,A

      20170505,3,A

      20170505,13,A

      20170506,6,A

      20170501,1,J

      20170602,2,A

      20170603,3,A

      20170604,4,A


      ];




      Set Vdim = DAT_CONSO_CONS_NEW;

      Set VAnneePrec = AddMonths($(Vdim),-12);



      When I try to use Count({$<DAT_CONSO_CONS_NEW = {"=$(VAnneePrec)"}>}IDF)  the result is the same than te current year.

       

      Exemple attached (select from 02/05/2018 to 05/05/2018 for exemple)

       

      Thanks.