Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
Luca_perdic
Contributor
Contributor

Load Sum invalid expression

Hi community!

I cannot solve this that seems a so stupid problem but maybe is there something i am missing.

When i try to load a table with the sum(field) formula i get the error "Invalid expression"

Load Distinct
Confirmation_Code,
Confirmation_Flag_Final,
sum(Confirmation_Qty_Posted) as [Daily Qty Confirmed],
sum(Confirmation_Qty_ActScrap) as [Daily Qty Scrap Confirmed]


Inline [
Confirmation_Code, Confirmation_Flag_Final, Confirmation_Qty_Posted, Confirmation_Qty_ActScrap
1 , X , 2 , 4
2 , , 3, 4
3 , , 4 , 5
3, , 4,5];

Labels (1)
1 Solution

Accepted Solutions
stevejoyce
Creator III
Creator III

You need to have a "group by".  Any field that is not in an aggregation needs to be listed in the group by or you will get this error.  Also group by cannot be done in a preceeding load, load your data first then resident the table.

Load Distinct
Confirmation_Code,
Confirmation_Flag_Final,
sum(Confirmation_Qty_Posted) as [Daily Qty Confirmed],
sum(Confirmation_Qty_ActScrap) as [Daily Qty Scrap Confirmed]

group by

Confirmation_Code,
Confirmation_Flag_Final

;

View solution in original post

2 Replies
stevejoyce
Creator III
Creator III

You need to have a "group by".  Any field that is not in an aggregation needs to be listed in the group by or you will get this error.  Also group by cannot be done in a preceeding load, load your data first then resident the table.

Load Distinct
Confirmation_Code,
Confirmation_Flag_Final,
sum(Confirmation_Qty_Posted) as [Daily Qty Confirmed],
sum(Confirmation_Qty_ActScrap) as [Daily Qty Scrap Confirmed]

group by

Confirmation_Code,
Confirmation_Flag_Final

;

View solution in original post

Luca_perdic
Contributor
Contributor
Author

Hi Stevejoice,

I see.. no shorcuts.

Thank you for the answer