Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Help with aggregation/group by

Hi everybody,

I have  a general question about group by statements. Right now I have a table where I want to Group based on OrderId but there are several other Fields. Say OrderId is Field 1, Field 2  might have different values but for every OrderId are unique and I have Field 3 which needs to be Summed. So I have the following

LOAD

     Field1,

     Field2,

     SUM(Field3) AS Field

RESIDENT

     Test

GROUP BY Field1

This statement will give an error since i think it is neccessary to include Field2 even tough this field has the same values for each value in Field1. Or I'm I incorrect on this assumption? Can anyone explain the exact rules for the fields which are not aggregated nor grouped but you do want to Load?

Tags (3)
1 Reply
Not applicable

Help with aggregation/group by

Hi

Every field that you use in the table where the group by happens, has to be mandatarily included in the where clause.

however the field used in the aggregation (here: Field 3) need not be included in the table.

So assumption is correct.

Community Browser