Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi the community,
I need to build a table with the sum of "visites" for each user "IDSSO".
Each "IDSSO" has several "cookies".
Each "IDSSO" makes several visits each month.
I tried to build the table "IDSSO" with a group by, but it does not work.
Any idea ?
--------------------------------------------------
Cookies:
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
Cookies_Visites
FROM
IDSSO:
LOAD
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
sum(Cookies_Visites) as Cookies_Visites
Resident Cookies
group by Cookies_Editeur,
Cookies_IDSSO
;
drop Table Cookies;
-----------------------------------------
Thank you for your help
mMay be try this?
Cookies:
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
Cookies_Visites
FROM
Left Join(Cookies)
IDSSO:
LOAD
Cookies_IDSSO,
sum(Cookies_Visites) as Cookies_Visites
Resident Cookies
group by
Cookies_IDSSO
;
drop Table Cookies;
Hi ,
Try like this.
Cookies:
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
Cookies_Visites
FROM
NoConcatenate
IDSSO:
LOAD
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
sum(Cookies_Visites) as Cookies_Visites
Resident Cookies
group by Cookies_Editeur,
Cookies_IDSSO
;
drop Table Cookies;
i believe this will throw Group By error as all the non aggr fields must be provide in the group by list.
mMay be try this?
Cookies:
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
Cookies_Visites
FROM
Left Join(Cookies)
IDSSO:
LOAD
Cookies_IDSSO,
sum(Cookies_Visites) as Cookies_Visites
Resident Cookies
group by
Cookies_IDSSO
;
drop Table Cookies;
Try This: (While using group by , all the non aggregated fields should be added under group by clause.
Cookies:
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
Cookies_Visites
FROM
Noconcatenate
IDSSO:
LOAD
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO,
sum(Cookies_Visites) as Cookies_Visites
Resident Cookies
group by
Cookies_Editeur,
Cookies_Year,
Cookies_Month,
Cookie,
Cookies_IDSSO
;
drop Table Cookies;
Br,
KC
you need to put all the non aggregated fields under group by clause as suggested in above comment.
Thank you for your help !
Thank you but i do not manage to make it work.
Anyway, thank you.
Thank you but i can not make it work with this solution.
Regards,