Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have uploaded the same field "Product" from 2 different file: the 1st with all the products and the 2nd with just some of them.
Now I'd like to have a table that shows just the product coming from the second file so the user can immediately select these products.
Any ideas??
Thanks!!
Hi
I would add a source field, like this:
Data:
LOAD Product,
'File1' As Source
FROM File1;
Concatenate (Data)
LOAD Product,
'File2' As Source
FROM File2;
Now just use Source as a filter.
HTH
Jonathan
Hi,
Rename that field and then use that field as filter
Try like
table2:
Load
Product as NewProduct,
Product //Use this if required for creating association else comment it.
from tableNAme;
From above script use NewProduct as filter
Regards
Hi
I would add a source field, like this:
Data:
LOAD Product,
'File1' As Source
FROM File1;
Concatenate (Data)
LOAD Product,
'File2' As Source
FROM File2;
Now just use Source as a filter.
HTH
Jonathan
Hi, I think your best option is to create a field to mark these products when you are loading them I'll need a sample script to be more specific but maybe could be one these options:
- Loading all products and mark those which exists in file 2
ProductTable:
LOAD IdProduct,...
FROM file1;
Concatenate
LOAD IdProduct,...
FROM file2;
Left Join (ProductTable)
LOAD IdProduct, '1' as _IsFromFile2
FROM file2;
- Load products from file2 marked and then load products from file1 wich not exists in file2
ProductTable:
LOAD IdProduct, '1' as _IsFromFile2,...
FROM file2;
Concatenate
LOAD IdProduct, '0' as _IsFromFile2,...
FROM file1 where not exist('IdProduct', IdProduct);
Hi Jonathan,
I might be wrong but, how can you select Products from the second table only, with your load script ?
Thanks!
Hi,
Nice one. I really like this logic and thanks for teaching this different way to develop script.
Thanks again.
Regards
Thanks, Jonathan solution works fine then I made a table with Source='file2' in the expression.