Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Sample code:
LOAD FIELD1, FIELD2, FIELD3, FIELD4;
LOAD FIELD1, FIELD2 FROM TABLE1_2.QVD (QVD); LOAD 1
LEFT JOIN LOAD FIELD1, FIELD3 FROM TABLE1_3.QVD (QVD); LOAD 2
LEFT JOIN LOAD FIELD3, FIELD4 FROM TABLE3_4.QVD (QVD); LOAD 3
Am I doing it wrong? What I'm tryng to do is load all loaded fields from LOAD 1 TO LOAD 3.
When I try to run the above code, the fields from LOAD 2 can no beb found. (FIELD 3 in would result to error.
Thank guys
~skip
Hi Vijay,
You right. Sure if I put the first statement then will got an error (LOAD FIELD1, FIELD2, FIELD3, FIELD4;). So that I take it out from my script. I think that my script is answer to qlikering issue. Otherwise if he want to follow his script, I think can be done by below:
[Data1]:LOAD FIELD1, FIELD2 FROM TABLE1_2.QVD (QVD); //LOAD 1
LEFT JOIN ([Data1]) LOAD FIELD1, FIELD3 FROM TABLE1_3.QVD (QVD); //LOAD 2
LEFT JOIN ([Data1]) LOAD FIELD3, FIELD4 FROM TABLE3_4.QVD (QVD); //LOAD 3
[Data2]:LOAD FIELD1, FIELD2, FIELD3, FIELD4 RESIDENT [Data1];
Regards,
Sokkorn Cheav
As you are using LEFT JOIN between LOAD 1 and LOAD 2, if the field names in LOAD 1 and LOAD 2 match, as you suggest in your example, you will only get records from LOAD 2 where FIELD1 matches exactly to FIELD1 in LOAD 1.
If there are any differences, eg. extra spaces, differences in case, slight spelling differences, then the records from LOAD 2 will not make it through.
If you want the data from LOAD 2 even when it does not match use a JOIN not a LEFT JOIN.
Hi,
Thanks for you reply.
It has to be LEFT JOIN since I only need to retain the records from the first table, all other records that that don't matches to the to this table should be discared.
Currentyl my solution is to just add another load from resident table.
Just asking if this kind of loading is not supported.
regards,
~skip
Hi Skip,
By using this code you can not achievethe required output because before loading Load2 it is going to top and trying to find Field3 which is not available in Load 1 and you are getting error.
You need to do your join first and then use resident load.
Hope this will help.
Hi qlikering,
It seem something wrong with your load script. Let try this
[Data1]:LOAD FIELD1, FIELD2 FROM TABLE1_2.QVD (QVD); //LOAD 1
LEFT JOIN ([Data1]) LOAD FIELD1, FIELD3 FROM TABLE1_3.QVD (QVD); //LOAD 2
LEFT JOIN ([Data1]) LOAD FIELD3, FIELD4 FROM TABLE3_4.QVD (QVD); //LOAD 3
Edit: You said error on LOAD 2 mean
LOAD FIELD1, FIELD3 FROM TABLE1_3.QVD (QVD); //Error ==> Make sure FIELD3 exist in your TABLE1_3.QVD
Regards,
Sokkorn Cheav
Hi Sokkorn,
He is trying to Join Tabales and then load some fields from resuting table in one load only which is not possible. Your scriopt is fine but if you do one load on top of it like
Load Field1,Field2,Field3; It will throw error.
regards
VIjay
Thanks Vijay,
Hi Sokkom,
The error is generated by the load on the top since it only load from the succeeding load not including in LEFT JOIN load where my other field is in.
Thanks guys,
Regards,
~skip
Hi Vijay,
You right. Sure if I put the first statement then will got an error (LOAD FIELD1, FIELD2, FIELD3, FIELD4;). So that I take it out from my script. I think that my script is answer to qlikering issue. Otherwise if he want to follow his script, I think can be done by below:
[Data1]:LOAD FIELD1, FIELD2 FROM TABLE1_2.QVD (QVD); //LOAD 1
LEFT JOIN ([Data1]) LOAD FIELD1, FIELD3 FROM TABLE1_3.QVD (QVD); //LOAD 2
LEFT JOIN ([Data1]) LOAD FIELD3, FIELD4 FROM TABLE3_4.QVD (QVD); //LOAD 3
[Data2]:LOAD FIELD1, FIELD2, FIELD3, FIELD4 RESIDENT [Data1];
Regards,
Sokkorn Cheav
Yup, Resident Load is the only solution I can find as of now.
Hi qlikering,
If my script can answer to your requirement, please help to mark it as answer to close your case.
Regards,
Sokkorn Cheav