Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

Use preceding load with group by

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;

15 Replies
zied_ahmed1
Specialist
Specialist
Author

When i use the latest code, I have this error:

error msg "Aggregation expressions required by group by clause but i don't know why because i use all fields in Load  in the group by

Digvijay_Singh

The error looks reasonable as there is no Sum,Min, Max, count  being used to group values using group by fields. What exactly you want to aggregate?

Digvijay_Singh

Pick(Match() is just a conditional statement, it will assign the correct value to STATUT based on Statut_sup value but  'group by'  is used to aggregate(sum,avg,  min, max, count)  facts based on our business needs.

zied_ahmed1
Specialist
Specialist
Author

ok...so this is not a solution for my question

zied_ahmed1
Specialist
Specialist
Author

Anonymous
Not applicable

If you uploaded a sample (it can be scrambled) then I could tell you what's the problem...

It's really hard without sample data...