Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Resident and Group by

Hello!

I get a invalid expression error on this scipt when trying to use sum and group by and its driving me insane. Any help?

VAtmp:

LOAD

     PART_NO,
     CONTRACT,
     ISSUE_QTY,
     Month
FROM
Z:\xxxx\xxxx\Extracted\Sup.QVD
(qvd);


VA:

LOAD

    PART_NO,
     CONTRACT,
     sum(ISSUE_QTY) as sumQTY,
     Month
    
Resident VAtmp Group by PART_NO;

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You need to either use an aggregation function around CONTRACT (could be something like concat(CONTRACT) as concatCONTRACT, only(CONTRACT) as CONTRACT or count(CONTRACT) as countCONTRACT or whatever appropriate)

or add CONTRACT to your group by fields (...group by PART_NO, CONTRACT; )


View solution in original post

2 Replies
swuehl
MVP
MVP

You need to either use an aggregation function around CONTRACT (could be something like concat(CONTRACT) as concatCONTRACT, only(CONTRACT) as CONTRACT or count(CONTRACT) as countCONTRACT or whatever appropriate)

or add CONTRACT to your group by fields (...group by PART_NO, CONTRACT; )


daveamz
Partner - Creator III
Partner - Creator III

Hello,

     You should group by all non-calculated fields: 

VA:

LOAD

    PART_NO,
     CONTRACT,
     sum(ISSUE_QTY) as sumQTY,
     Month

Resident VAtmp Group by PART_NO, CONTRACT, Month;