7 Replies Latest reply: Mar 29, 2017 4:00 AM by Zied Ahmed RSS

    Problem in script

    Zied Ahmed

      Hello,I have a script work :

      tmp:

      load *;

      SELECT CodAttivita,

        ACTIVITE,

        sens,

        FilialeInserimento,

        FilOrigine,

        PaysOrigine,

        FilialeDestino,

        CodLinea as Code_Ligne,

        Dossier,

        ViaggioNave,

          "Statut_Flotte",

        cast("date_dossier" as date) as  date_dossier,

        DateEmbarquement,

        DateDebarquement,

        VideCpltGrpg,

        Plaque,

        TypeMateriel,

          DesCompagnia,

        Remorque,

          Parc,

        ViaggioLinea,

          carrier

      FROM

      where (ACTIVITE='RORO' and ViaggioNave>0);

      load *;

      SELECT CodAttivita,

        ACTIVITE,

        sens,

        FilialeInserimento,

        FilOrigine,

        PaysOrigine,

        FilialeDestino,

        CodLinea as Code_Ligne,

          "Statut_Flotte",

        Dossier,

        ViaggioNave,

        cast("date_dossier" as date) as  date_dossier,

        DateEmbarquement,

        DateDebarquement,

        VideCpltGrpg,

        Plaque,

        TypeMateriel,

           DesCompagnia,

        Remorque,

          Parc,

        ViaggioLinea,

          carrier

      FROM

      where (ACTIVITE<>'RORO');

       

       

      left join(tmp)

       

       

      LOAD

          Pays,

          Langitude,

          Latitude,

          Code_Ligne

      FROM

       

       

      [COM_BI_Dossier_Cat]:

      LOAD

         autonumber( date(date_dossier, 'DD/MM/YYYY'),'%Date ID')  as [%Date ID]

         ,CodAttivita as Code_Activite,

        ACTIVITE as Designation_Activite,

        sens as Sens,

        FilialeInserimento as Filiale_Creation_Dossier,

        FilOrigine as [Filiale Origine],

        PaysOrigine as [Pays Fililale Origine],

        FilialeDestino as [Filiale Destination],

        Code_Ligne as Code_Ligne,

        Dossier as Num_Dossier,

        ViaggioNave as Num_Voyage,

        date(date_dossier,'DD/MM/YYYY') as Date_Dossier,

        DateEmbarquement as Date_Embarquement,

        DateDebarquement as Date_Debarquement,

           "Statut_Flotte" as "Statut Flotte",

        VideCpltGrpg as Groupe_Complet_Vide,

        Plaque,

           Parc,

        TypeMateriel as Type_Materiel,

            DesCompagnia as Compagnie,

        Remorque as Remorque_Parc_HorsParc,

        ViaggioLinea as Voyage_Ligne,

         // ViaggioNave as Voyage_bateau,

        carrier as Code_Carrier

          ,Pays,

          geomakepoint(Latitude,Langitude) as PAYS2

      resident tmp  ;

      drop table tmp;

       

      NoConcatenate

      final_tmp:

      load*,'Vide' as Charge_Vide;

      load * Resident [COM_BI_Dossier_Cat] where (upper(Groupe_Complet_Vide)='V');

       

      load*,'Chargé' as Charge_Vide;

      load * Resident [COM_BI_Dossier_Cat] where (upper(Groupe_Complet_Vide)<>'V');

      drop table final_tmp;

       

       

      but when i add this block of script the values becomes wrong :

       

      Fact_Final:

      Load  Date_Embarquement,   

          Plaque,

          if( Nombre_Carrier>1, 1, 0) as Flag_Doublon;

      LOAD  

          Date_Embarquement,   

          Plaque,  

        count(Code_Carrier) as Nombre_Carrier

      Resident final_tmp

      Where Code_Ligne = 'MAR' 

      Group by Date_Embarquement,Plaque

      ;

      join(Fact_Final)

       

       

      LOAD  *

      Resident final_tmp

      Where Code_Ligne = 'MAR'  ;

      Concatenate

       

       

      load * resident final_tmp where Code_Carrier <>'MAR';

       

      What i can do to resolve this problem ? Thanks