Qlik Community

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
ingo_lsg
New Contributor III

Group by clause only works when using all dimensions

The following load statement doesn't work, when not using all of the loaded dimensions. (here in this example I didn't use TYPE_OF_SVC.

 

Any idea?

 

Load
    KEY_Ausland,
    PERIODE_NR_ROW,
    CARRIER_ALN_CD_ROW,
   TYPE_OF_SVC,
    SUM(CAP_FST_AMT+ CAP_BSN_AMT+ CAP_PEC_AMT+CAP_ECO_AMT ) as SEATS_TTL_NR_ROW,
 sum(STARTS_TTL_NR_ROW) as STARTS_TTL_NR_ROW
Resident Nachfrage_Angebot_Temp
Group by KEY_Ausland,PERIODE_NR_ROW, CARRIER_ALN_CD_ROW;
//,TYPE_OF_SVC;
Drop Table Nachfrage_Angebot_Temp;

2 Replies
MVP & Luminary
MVP & Luminary

Re: Group by clause only works when using all dimensions

If you use a GROUP BY then all the fields that are not used in aggregation functions (like sum) must be included in the GROUP BY clause. So a field is either in the GROUP BY or used in a sum/count/max/min (or any other aggregation) function.


talk is cheap, supply exceeds demand
ingo_lsg
New Contributor III

Re: Group by clause only works when using all dimensions

So, when I want to add additional fields I would have to do this in a second resident load?