Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can i filter customers not having USD account? I want to only see customer 1001 as result.
CUSTOMERID | ACCOUNTNUMBER | ACCOUNTTYPE |
1000 | 9000 | USD |
1000 | 9001 | USD |
1000 | 9002 | EUR |
1001 | 9003 | EUR |
1001 | 9004 | GBP |
1002 | 9005 | USD |
1002 | 9006 | USD |
I find a solution
TABLE1:
LOAD
CUSTOMERID as CUSTOMERID1,
CUSTOMERID as CUSTOMERIDTEMP1,
ACCOUNTNUMBER,
ACCOUNTTYPE
FROM [lib://AttachedFiles/sample.xlsx]
(ooxml, embedded labels, table is Sheet1) Where ACCOUNTTYPE = 'USD' ;
TABLE2:
LOAD
CUSTOMERID as CUSTOMERID2,
CUSTOMERID as CUSTOMERIDTEMP2,
ACCOUNTNUMBER,
ACCOUNTTYPE
FROM [lib://AttachedFiles/sample.xlsx]
(ooxml, embedded labels, table is Sheet1);
NEwTable1:
LOAD
CUSTOMERID1 as CUSTOMERIDNew,
ACCOUNTNUMBER,
ACCOUNTTYPE
Resident TABLE1
Where Not Exists(CUSTOMERIDTEMP2,CUSTOMERID1);
Concatenate
NewTable2:
Load
CUSTOMERID2 as CUSTOMERIDNew,
ACCOUNTNUMBER,
ACCOUNTTYPE
Resident TABLE2
Where Not Exists(CUSTOMERIDTEMP1,CUSTOMERID2);
DROP Table TABLE1;
Drop Table TABLE2;
Maybe this
Only({<ACCOUNTTYPE={'*'}-{'USD'}>}CUSTOMERID)
I want to filter it while loading data because my data is too much big with USD accounts.
This does not work because customer 1000 have USD and non USD accounts
I find a solution
TABLE1:
LOAD
CUSTOMERID as CUSTOMERID1,
CUSTOMERID as CUSTOMERIDTEMP1,
ACCOUNTNUMBER,
ACCOUNTTYPE
FROM [lib://AttachedFiles/sample.xlsx]
(ooxml, embedded labels, table is Sheet1) Where ACCOUNTTYPE = 'USD' ;
TABLE2:
LOAD
CUSTOMERID as CUSTOMERID2,
CUSTOMERID as CUSTOMERIDTEMP2,
ACCOUNTNUMBER,
ACCOUNTTYPE
FROM [lib://AttachedFiles/sample.xlsx]
(ooxml, embedded labels, table is Sheet1);
NEwTable1:
LOAD
CUSTOMERID1 as CUSTOMERIDNew,
ACCOUNTNUMBER,
ACCOUNTTYPE
Resident TABLE1
Where Not Exists(CUSTOMERIDTEMP2,CUSTOMERID1);
Concatenate
NewTable2:
Load
CUSTOMERID2 as CUSTOMERIDNew,
ACCOUNTNUMBER,
ACCOUNTTYPE
Resident TABLE2
Where Not Exists(CUSTOMERIDTEMP1,CUSTOMERID2);
DROP Table TABLE1;
Drop Table TABLE2;