I have two CSV files with the same headers. The only difference between the files is that it contains data from two different dates. For example one csv file has data for today's sales. The other CSV file has yesterday's sales. In Celonis I have already uploaded the CSV for yesterday's sales. How do I now upload and combine the CSV for today's sales, into the data for yesterday's sales which is already in Celonis.
Hi @jed.nkans ,
I think combining the two tables can be achieved by using transformation job in the data pool.
If there is a date column in your files, then I would suggest:
1- DROP TABLE IF EXISTS "SALES";
2- CREATE TABLE "SALES" AS (
SELECT
*
FROM "yestrday.CSV"
);
3- INSERT INTO "SALES"
SELECT
*
FROM "today.CSV"
In the case that the csv files does not include a Date Column you can create a column date:
1- DROP TABLE IF EXISTS "SALES";
2- CREATE TABLE "SALES" AS (
SELECT
* , '17/11/2021' as MY_DATE
FROM "yestrday.CSV"
);
3- INSERT INTO "SALES"
SELECT
* , '18/11/2021' as MY_DATE
FROM "today.CSV"
After this, you can import the SALES table into the data model and not directly the csv file and should work,
Hope it helps
Javier
Hi @jed.nkans ,
I think combining the two tables can be achieved by using transformation job in the data pool.
If there is a date column in your files, then I would suggest:
1- DROP TABLE IF EXISTS "SALES";
2- CREATE TABLE "SALES" AS (
SELECT
*
FROM "yestrday.CSV"
);
3- INSERT INTO "SALES"
SELECT
*
FROM "today.CSV"
In the case that the csv files does not include a Date Column you can create a column date:
1- DROP TABLE IF EXISTS "SALES";
2- CREATE TABLE "SALES" AS (
SELECT
* , '17/11/2021' as MY_DATE
FROM "yestrday.CSV"
);
3- INSERT INTO "SALES"
SELECT
* , '18/11/2021' as MY_DATE
FROM "today.CSV"
After this, you can import the SALES table into the data model and not directly the csv file and should work,
Hope it helps
Javier
Hi Jed,
The suggestions from Javier should work indeed, and another idea could be to use the UNION or UNION ALL function to create the unified table directly.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.