Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have three table.These table are containing various values.then how to load in three tables to one table and how to join these tables.
Hi Mani,
I assume that the original data is like this: three different tables:
The way to load the three tables in a single Result_Table would be:
Result_Table:
Load
'Matching' as Status,
Value as ID
From Matching_table;
Load
'Not_Matching' as Status,
Value as ID
From Not_Matching_table;
Load
'Rejected' as Status,
Value as ID
From Rejected_table;
Hope this helps!
Hello Mani,
did you have the chance to try the proposed solution?
Regards!
If you want some more information about Joins, read about it here: Understanding Join, Keep and Concatenate
Best Regards,
Lucas
I can't load this tables.Because this a temporary Table.In three tables are converted from Two tables.My Script is,
Table1:
LOAD
@1 as key,
@5, SubField(@5,'-',1) as Field1
FROM
D:\QlikView\POC\Test1.txt
(txt, codepage is 1252, no labels, delimiter is spaces, msq, header is 1 lines);
join
Table2:
LOAD
@1 as key,
@7, SubField(@7,'.',1) as Field2
FROM
D:\QlikView\POC\Test2.txt
(txt, codepage is 1252, no labels, delimiter is ' ', msq, header is 1 lines);
Matching:
load
Field1,Field2as Matching
resident Table1
where Field1= Field2;
Not_Matching:
LOAD
Field2 as Not_Matching
resident Table1
where not Exists(Field1,Field2);
join
LOAD
Field1 as Not_Matching
resident Table1
where not Exists(Field2,Field1);
Cancel:
LOAD
@1 as key,
@4 as Rejected
FROM
D:\QlikView\POC\Test1.txt
(txt, codepage is 1252, no labels, delimiter is spaces, msq, header is 1 lines);
anything else,
Hi,
Just put this after you script:
Result_Table:
Load
'Matching' as Status,
Field2 as ID
From Matching;
Load
'Not_Matching' as Status,
Field2 as ID
From Not_Matching;
Load
'Rejected' as Status,
Rejected as ID
From Cancel;
drop tables Matching, Not_Matching, Cancel;
Hope this helps!
when i run the script, i got the following error,
Sorry, my fault (please replace FROM with RESIDENT):
Result_Table:
Load
'Matching' as Status,
Field2 as ID
resident Matching;
Load
'Not_Matching' as Status,
Field2 as ID
resident Not_Matching;
Load
'Rejected' as Status,
Rejected as ID
resident Cancel;
drop tables Matching, Not_Matching, Cancel;
This means you need to define the path for the file you're importing your information from! (e.g. From D:\MyFiles\Matching.xls) Otherwise your script should be correct.
Greetings,
Lucas
EDIT: Didn't see the whole conversation before, sorry
Load your table with concatenate function and add the one field for three table
like
table1:
load A,
B,
'Matching' as StatusField from table1;
concatenate(table1)
table2:
load C,
D,
'Non-Matching' as StatusField from table2;
concatenate(table1)
table3:
load E,
F,
'Rejected' as StatusField from table3;
Thanks Jose,
Your Script is correct Solution for my Scenario,Thank you for your Commend.