Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

Using Preceding load for this example

I would like to use Preceding Load with this code :

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;

11 Replies
tamilarasu
Champion
Champion

Zied,

Here is a small method. You can alter the group by clause and the field names as per your need.

For Each Status in 'Actif', 'Inactif', 'Bloquée'


Result:
Load date,
car as car,
mat,
count(Statut_sup) as nbr,
Pick(Wildmatch(Statut_sup,'Actif','Inactif','Bloquée'),'ON','OFF','Bloquée') as STATUT
Resident table1
Where Statut_sup = '$(Status)' And Date = Today()
Group by date, car, mat;

Next Status

DROP Table table1;

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

Concatenate
Load *
resident Fact ;


  drop table Fact;

Anil_Babu_Samineni

May be Field name misplaced STATUT instead of Statut_sup

Pick(Wildmatch(STATUTStatut_sup,'Actif','Inactif','Bloquée'),'ON','OFF','Bloquée') as STATUT


Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful