Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
yankeybeans
Contributor II
Contributor II

summing a resident table error

I loaded two columns of data from a qvd file into table_1: employee, hours_worked. There are many hours_worked rows for each employee.

I'm trying to create a [Results] table that sums all hours_worked for each employee (one row per employee).

[Results]:
NoConcatenate
load

[Employee] as Emp
, sum([hours_worked]) as Total_HRS


Resident [table_1]
;

I'm getting an 'invalid expression' error.  Note: the script does work if I only inlclude the sum([hours_worked]) line, but of course, I only get one row in Results table showing the total hours_worked by all employees.

Labels (2)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

HI @yankeybeans ,

You have yo add Group By to your statement as below:

[Results]:
NoConcatenate
load

[Employee] as Emp
, sum([hours_worked]) as Total_HRS


Resident [table_1] Group by [Employee];

Best Regards

View solution in original post

2 Replies
agigliotti
Partner - Champion
Partner - Champion

HI @yankeybeans ,

You have yo add Group By to your statement as below:

[Results]:
NoConcatenate
load

[Employee] as Emp
, sum([hours_worked]) as Total_HRS


Resident [table_1] Group by [Employee];

Best Regards

yankeybeans
Contributor II
Contributor II
Author

Agigliotti,

Thanks so much.

Yankeybeans