Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a list of projects from the source A. And have the second list of projects from the source B. How do I list A-B or vice verse?
Is it in the script you want to take care of it? It might not be the most optimized way, but here is an example
Table1:
Load * inline [
Num, Label1
1,a
2,b
3,c];
Table2:
Load * inline [
Num, Label2
3,c
4,d
5,e];
Final:
Load Num, Label1 as Label, 'Table1' as Source
Resident Table1
Where NOT Exists(Label2,Label1);
concatenate
Load Num, Label1 as Label, 'Both' as Source
Resident Table1
Where Exists(Label2,Label1);
concatenate
Load Num, Label2 as Label, 'Table2' as Source
Resident Table2
Where Not Exists (Label1, Label2);
Drop table Table1;
Drop table Table2;
Make sure you have a keyfield in both sources with the same name then it will connects automaticly when you load.
If you share your loading script I glady have a look at it.
Yea. I named the both fields same. Currently, I can distinguish the source of the projects, whether from list A or B. However, I don't know a way to have a chart (or a list etc.) listing only projects which are from source A but not in source B (A-B) or vice verse.
In addition to naming the keyfield the same, for example project, you can added an addtional field to identify the project as A or B.
project,
project AS project A
project AS project B.
QlikView will not see these as keys so you can identifiy each project.
These can also be counted in expressions.
Hope this helps.
Don
Is it in the script you want to take care of it? It might not be the most optimized way, but here is an example
Table1:
Load * inline [
Num, Label1
1,a
2,b
3,c];
Table2:
Load * inline [
Num, Label2
3,c
4,d
5,e];
Final:
Load Num, Label1 as Label, 'Table1' as Source
Resident Table1
Where NOT Exists(Label2,Label1);
concatenate
Load Num, Label1 as Label, 'Both' as Source
Resident Table1
Where Exists(Label2,Label1);
concatenate
Load Num, Label2 as Label, 'Table2' as Source
Resident Table2
Where Not Exists (Label1, Label2);
Drop table Table1;
Drop table Table2;
Your solution works fine in order to only list few fields in the manner I want . However, I have more than 20 fields along with to operate on in both Table 1 and Table 2. So, in my case QV can't manage to load the data; waiting for minutes, then freezing.
I have fixed my issue. I used your way to distingue the sources and to collect the data from the two tables into the final table with the related information and id only. Then I reloaded Table1 and Table2 with all the fields, and making a logical connection between the final table and these two full loaded tables through id fields by naming them same.