Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community
How can I generate a code when joining two tables?
Example:
Tabla 1 (Database) + 200 records
Tabla 2(Database) + 200 records
Table 3(Excel) has the code... depending on the condition. (+ 200 records...many combinations)
thanks for your time.
cheers
Renzo
Try
ExcelMap:
Mapping LOAD
Hash128("ID-PAR",ID,Marca,Color,...),
"TYP-ID"
From ...Sheet1:
ExcelExist:
LOAD
Hash128("ID-PAR",ID,Marca,Color,...) as KeyToCheck
From ...Sheet1:
TMP:
LOAD *,
Hash128("ID-PAR",ID,Marca,Color,...) as Key;
//T1:
LOAD * From Table1;
Join
T2:
LOAD * From Table2;
Final:
LOAD *,
If(Exists(KeyToCheck,Key),ApplyMap('ExcelMap',Key,'No ID')) as "TYP-ID"
Resident TMP;
DROP ExcelExist,Table TMP;
DROP Field Key;
Could you elaborate?
Hi @BrunPierre
I receive an excel with many combinations.
Each combination has a code.
Now when loading the 2 tables from the database, I have to check if an Excel combination exists and if it exists I give it the code.
Cheers
Renzo
Try
ExcelMap:
Mapping LOAD
Hash128("ID-PAR",ID,Marca,Color,...),
"TYP-ID"
From ...Sheet1:
ExcelExist:
LOAD
Hash128("ID-PAR",ID,Marca,Color,...) as KeyToCheck
From ...Sheet1:
TMP:
LOAD *,
Hash128("ID-PAR",ID,Marca,Color,...) as Key;
//T1:
LOAD * From Table1;
Join
T2:
LOAD * From Table2;
Final:
LOAD *,
If(Exists(KeyToCheck,Key),ApplyMap('ExcelMap',Key,'No ID')) as "TYP-ID"
Resident TMP;
DROP ExcelExist,Table TMP;
DROP Field Key;