Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

adding (sum) numbers on the load section

Dear community, I'm having a problem with some data that I need to add on the load section, but I'm not sure if it can even be done.

The data I have is like this:

     

NameActivityHours
DaveA 2
DaveB2
DaveC2
PeterA 3
PeterB2

The thing is that i need to create a new column that contains the adding number, like this:

     

NameActivityHoursTotal Hours
DaveA 26
DaveB26
DaveC26
PeterA 35
PeterB25

So Dave has 6 Hours and Peter 5.

Is there a way to add the numbers on the loading section?

The problem is that this information comes from one set of data, I have two more that comes with the columns with the total hours.

Thanks alot

8 Replies
sunny_talwar

You sure can:

Table:

LOAD Name,

     Activity,

     Hours

FROM

[https://community.qlik.com/thread/198409]

(html, codepage is 1252, embedded labels, table is @1);

Join (Table)

LOAD Name,

  Sum(Hours) as [Total Hours]

Resident Table

Group By Name;


Capture.PNG

rubenmarin

Hi Francisco, you can add the TotalHours with a left join. As an example:

Data:

LOAD * Inline [

Name,Activity,Hours

Dave,A,2

Dave,B,2

Dave,C,2

Peter,A,3

Peter,B,2

];

Left join (Data)

LOAD Name, Sum(Hours) as TotalHours Resident Data Group By Name;

Returns:

I don't understand the problem in your last sentence, not sure if you need something more.

Anonymous
Not applicable
Author

Hi Francisco,

Data:

LOAD Name,

    Activity,

    Hours

FROM.....

Left Join (Data)

LOAD Name,

  Sum(Hours) as [Total Hours]

Resident Data

Group By Name;

Please elaborate on your last requirement,is total hours column in another table or do you have other columns(in other table or data set) we need to include in calculations.

Regards

Neetha

Anonymous
Not applicable
Author

Its another column in another table

sunny_talwar

What is another column in another table??

Anonymous
Not applicable
Author

please specify about other column in other table, so can help.

Anonymous
Not applicable
Author

Sorry, what I wanted to say is that, the originals data comes from a file, then from that file i want to create another one that has the same information but also the new column that is "Total Hours".

maxgro
MVP
MVP

add a store to the end of Sunny's code; Table.txt is the new file with the new column Total Hours (see image)

STORE Table into Table.txt (txt);

1.png