4 Replies Latest reply: Sep 25, 2017 3:45 AM by Mikael Schmitz RSS

    Calculate date, based on Min(Date) - Load Script

    Mikael Schmitz

      Hello Qlik Friends,

       

      I have a little question. Hopefully someone have any idea or a solution for that.

       

      I tried it with Previous() function, but it doenst worked, because I got only the previous date of Column("DATE"). I would like to create a column which contains the DATE, based on TYPE.

       

      I searched for a similiar discussion, but I found only this discussion.

      https://community.qlik.com/message/1188605#1188605

       

      This is the table with the columns RowNo, MATNR, TYPE and DATE, which is sorted by DATE and RowNo.

       

      RowNoMATNRTYPEDATE
      192951012017-08-08
      292951032017-08-11
      392951012017-08-15
      492951012017-08-21
      592951012017-09-01
      692951032017-09-09
      792951032017-09-11

       

      I would like to create a column, which contains only the DATE for TYPE 101, but with the last DATE.

      See table below:

       

      RowNoMATNRTYPEDATEDATE_RECEIPT
      192951012017-08-082017-08-08
      292951032017-08-112017-08-08
      392951012017-08-152017-08-15
      492951012017-08-212017-08-21
      592951032017-09-092017-08-21
      692951032017-09-112017-08-21

       

      My First script:

      /*******************************************************

      Table:

      Load * inline

      [

      RowNo,MATNR,TYPE,DATE

      1,9295,101,2017-08-08

      2,9295,103,2017-08-11

      3,9295,101,2017-08-15

      4,9295,101,2017-08-21

      5,9295,101,2017-09-09

      6,9295,103,2017-09-11

      ];

       

      stalwar1, maybe you have an idea.

       

      Thanks in advance.

       

      Best regards,

      mikaschm61