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

Precending load

here's my problem, i have two excel files, every file has a lot of fields for example,

first file,

file 1;

load

A

B

C

D

E

FROM file1;


second file

X

H

J

G

M

N

FROM FILE 2

what i want to do is:

take the field B and the field M and make the sum.

that's all.

thank's for help

13 Replies
Not applicable
Author

No, what i want to do is to create a new column in the script

for exemple:

sum(B)+sum(M) as la_somme

but what you should to know is, B and M are in different files, this is the problem.

kuba_michalik
Partner - Specialist
Partner - Specialist

What do you want to do exactly? Sum all values in B together with all values in M, but in the script? First, it's way easier in the frontend, as Ashfaq Mohammed pointed out. Second, if you really need to do it in the script, then one way is this:

Temp1:

LOAD

     Sum(B) as SumB

Resident NameOfTableWith_B_Column;

Temp2:

LOAD

     Sum(M) as SumM

Resident NameOfTableWith_M_Column;

LET vSumOfBandM = Peek('SumB')+Peek('SumM');

DROP TABLES Temp1, Temp2;

Now you have the sum in variable vSumOfBandM and can do with it whatever you need to do.

Again, if you don't absolutely need this sum in the script for some calculations or something, then don't do it in the script. Calculate it directly in the frontend.

Not applicable
Author

thnx it works.

kuba_michalik
Partner - Specialist
Partner - Specialist

Please mark it as a correct answer then (not to be asking for accolades, but it marks the question as answered which helps for other people viewing the forum)