2 Replies Latest reply: Feb 7, 2018 9:28 AM by Chadlia Gabsi RSS

    Delete Succession value

    Chadlia Gabsi

      Morning,

      how can i delete succession value of 0 1 and need to show just the red case (input, output of employee).

      My script :

      T1:

      load

      DIRECTION ,MATRICULE,

      MOIS,ANNEE

      Resident D_

      ;

      T2 :

      load

      MATRICULE_AGENT, MOIS, ANNEE,DIRECTION,

      if(MATRICULE=Previous(MATRICULE) and DIRECTION<>Previous(DIRECTION) ,1,0) as FLAG

      Resident T1

      order by MOIS;

      drop table T1;

      left join(T2)

      load

      MATRICULE, DIRECTION, MOIS,ANNEE,

      if(FLAG=1,1,0) as ENTREE,

        if(FLAG=0,1,0) as SORTIE

      Resident T2

      order by MOIS;

      TF:

      load MATRICULE, DIRECTION, MOIS, ANNEE,

      ENTREE, SORTIE

      resident T2

      order by MOIS;

      drop Table T2 ;

      Sans titre.png