Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Group by

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 (XmlSimple, Table is [DataFeed/DataSet/Rows/Row]);



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

1 Solution

Accepted Solutions
Highlighted
Champion III
Champion III

Re: Group by

‌mMay be try this?

Cookies:

    Cookies_Editeur,

    Cookies_Year,

    Cookies_Month,

    Cookie,

    Cookies_IDSSO,

    Cookies_Visites

FROM (XmlSimple, Table is [DataFeed/DataSet/Rows/Row]);


Left Join(Cookies)


IDSSO:

LOAD

Cookies_IDSSO,

sum(Cookies_Visites) as Cookies_Visites


Resident Cookies

group by

Cookies_IDSSO

;


drop Table Cookies;

View solution in original post

8 Replies
Highlighted
Master II
Master II

Re: Group by



Hi ,

Try like this.


Cookies:

    Cookies_Editeur,

    Cookies_Year,

    Cookies_Month,

    Cookie,

    Cookies_IDSSO,

    Cookies_Visites

FROM (XmlSimple, Table is [DataFeed/DataSet/Rows/Row]);



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;

Highlighted
Champion III
Champion III

Re: Group by

‌i believe this will throw Group By error as all the non aggr fields must be provide in the group by list.

Highlighted
Champion III
Champion III

Re: Group by

‌mMay be try this?

Cookies:

    Cookies_Editeur,

    Cookies_Year,

    Cookies_Month,

    Cookie,

    Cookies_IDSSO,

    Cookies_Visites

FROM (XmlSimple, Table is [DataFeed/DataSet/Rows/Row]);


Left Join(Cookies)


IDSSO:

LOAD

Cookies_IDSSO,

sum(Cookies_Visites) as Cookies_Visites


Resident Cookies

group by

Cookies_IDSSO

;


drop Table Cookies;

View solution in original post

Highlighted
Master II
Master II

Re: Group by

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 (XmlSimple, Table is [DataFeed/DataSet/Rows/Row]);


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

Best Regards,
KC
Highlighted
Master
Master

Re: Group by

you need to put all the non aggregated fields under group by clause as suggested in above comment.

Highlighted
Creator
Creator

Re: Group by

Thank you for your help !

Highlighted
Creator
Creator

Re: Group by

Thank you but i do not manage to make it work.

Anyway, thank you.

Highlighted
Creator
Creator

Re: Group by

Thank you but i can not make it work with this solution.

Regards,