Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
So I need to use data from 2 different tables to calculate fields in a third table. Let's say my data is something like this:
tblOne: LOAD
Data1
FROM ...;
tblTwo:
LOAD
Data2
FROM ...;
Browsing the forum, I came up with something like this to use these 2 fields (Data1 and Data2) to calculate a third one.
tblTempo:
LOAD Data1 FROM tblOne;
Join(tblTempo) LOAD Data2 FROM tblTwo;
tblThree:
LOAD
Data1 + Data2 as Data3
RESIDENT tblTempo;
DROP TABLE tblTempo;
Currently, I get the error "No qualified path for file: ***" on my "LOAD Data1 FROM tblOne" line. I'm guessing this has something to do with how I refer to my tblOne.
Does anyone have a clue as to how I should proceed to solve this issue?
Thank you guys very much,
LesJean
try this:
tblOne:
Load * Inline [
Data1
1
2
3
];
tblTwo:
Load * Inline [
Data2
1
2
3
];
Store tblOne into tblOne.qvd(qvd);
Drop table tblOne;
Store tblTwo into tblTwo.qvd(qvd);
Drop table tblTwo;
tblTempo:
LOAD Data1
FROM tblOne.qvd(qvd);
Join(tblTempo)
LOAD Data2
FROM tblTwo.qvd(qvd);
final_table:
LOAD *,
Data1 + Data2 as Data3
resident tblTempo;
DROP TABLE tblTempo;
exit script;
try this:
tblOne:
Load * Inline [
Data1
1
2
3
];
tblTwo:
Load * Inline [
Data2
1
2
3
];
Store tblOne into tblOne.qvd(qvd);
Drop table tblOne;
Store tblTwo into tblTwo.qvd(qvd);
Drop table tblTwo;
tblTempo:
LOAD Data1
FROM tblOne.qvd(qvd);
Join(tblTempo)
LOAD Data2
FROM tblTwo.qvd(qvd);
final_table:
LOAD *,
Data1 + Data2 as Data3
resident tblTempo;
DROP TABLE tblTempo;
exit script;
Thanks to both of you,
Marcos, your solution seems to be working for me, but I was wondering, since this will be run daily, I need to make sure to not accumulate data. Is there anyway to delete the .qvd files created during the process in the code?
Thank you,
LesJean