Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

script for Preceding load

Hello I have this code and i would like to use Preceding Load

LOAD

    * WHERE  "date"= Today() ;

    load

       date,

          car as car,

         mat ,

         Tax,

         'ON'  as STATUT,

         count(Statut_sup) as nbr

         resident table1

         where Statut_sup='Actif'

         group by

        date_flotte,

         Taux,

         //[%Date ID],

         car ,

         mat;

      

       

         Concatenate  

           load

      Pla,

     

        date,

         car as car,

         mat,

           'OFF'  as STATUT,

         count(Statut_sup) as nbr

         resident table1

         where Statut_sup='Inactif'

         group by  date,

         car,

         mat,

Pla;

        

     

          Concatenate  

           load

       date,

     

         car as car,

         mat,

          'Bloquée'  as STATUT,

         count(Statut_sup) as nbr

         resident table1

         where Statut_sup='Bloquée'

         group by  date,

         car,

         mat;

drop table table1;

       

    STORE [FlotteFinal] into [$(vQvdPath)\QVD_final.qvd](qvd);

          Concatenate

             Load*

             resident Fact ;

             drop table Fact;

2 Replies
Anonymous
Not applicable

Hi

It is not possible to do a preceding load based on several LOAD instructions.

Something like LOAD .... ; (Combination of load statements); would be great, but does not work, unfortunately.

So you need to reorganise your script.

UnlimitedTable:

load

     date,

     car as car,

     mat ,

     Taux,

     'ON'  as STATUT,

     count(Statut_sup) as nbr

resident

     table1

where

     Statut_sup='Actif'

group by

     date_flotte,

     Taux,

     car,

     mat;

Concatenate  (UnlimitedTable)

load

     Pla,

     date,

     car as car,

     mat,

     'OFF'  as STATUT,

     count(Statut_sup) as nbr

resident

     table1

where

     Statut_sup='Inactif'

group by 

     date,

     car,

     mat,

     Pla;

Concatenate  (UnlimitedTable)

load

     date,

     car as car,

     mat,

     'Bloquée'  as STATUT,

     count(Statut_sup) as nbr

resident

     table1

where

     Statut_sup='Bloquée'

group by     

     date,

     car,

     mat;

// Now it is not clear to me if you want to store all data, or only data with date = today

// If it is all data

STORE UnlimitedTable INTO ...

CONCATENATE (Fact) LOAD * RESIDENT UnlimitedTable WHERE date = today();

DROP TABLE UnlimitedTable;

// If it is only a subset of data (date = today)

LimitedTable:

NOCONCATENATE LOAD * RESIDENT UnlimitedTable WHERE date = today();

STORE LimitedTable INTO...

CONCATENATE (Fact) LOAD * RESIDENT LimitedTable;

DROP TABLES UnlimitedTable, LimitedTable;

Hope it helps

zied_ahmed1
Specialist
Specialist
Author

Hello Pierre,

Thanks  for your answer,I have this code just before this one :

LOAD

     date,

    

     Pla,

     Mat,

     Taux,Plaque  FROM [$(vQvdPath)\QVD.qvd] (qvd) ;

Concatenate

Concatenate old data with the data of today...