Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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;