diff --git a/definitions/export/all_interactions_export.sqlx b/definitions/export/all_interactions_export.sqlx new file mode 100644 index 0000000..19eeed8 --- /dev/null +++ b/definitions/export/all_interactions_export.sqlx @@ -0,0 +1,10 @@ +config { + type: "table", + schema: "pphe_five9_gold", + tags: ["daily"], + description: "Exporting last 5 days of ALL_INTERACRIONS_SUM table" +} + +select * +from ${ref("ALL_INTERACRIONS_SUM")} +where date(timestamp_millisecond) >= date_sub(current_datetime("Europe/Amsterdam"), INTERVAL 5 DAY) \ No newline at end of file diff --git a/definitions/export/calls_export.sqlx b/definitions/export/calls_export.sqlx new file mode 100644 index 0000000..9ac16ff --- /dev/null +++ b/definitions/export/calls_export.sqlx @@ -0,0 +1,10 @@ +config { + type: "table", + schema: "pphe_five9_gold", + tags: ["daily"], + description: "Exporting last 5 days of CALLS table" +} + +select * +from ${ref("CALLS")} +where date(timestamp_millisecond) >= date_sub(current_datetime("Europe/Amsterdam"), INTERVAL 5 DAY) \ No newline at end of file diff --git a/definitions/export/digital_export.sqlx b/definitions/export/digital_export.sqlx new file mode 100644 index 0000000..cf66961 --- /dev/null +++ b/definitions/export/digital_export.sqlx @@ -0,0 +1,10 @@ +config { + type: "table", + schema: "pphe_five9_gold", + tags: ["daily"], + description: "Exporting last 5 days of DIGITAL table" +} + +select * +from ${ref("DIGITAL")} +where date(timestamp_millisecond) >= date_sub(current_datetime("Europe/Amsterdam"), INTERVAL 5 DAY) \ No newline at end of file diff --git a/definitions/gold/ALL_INTERACRIONS_SUM.sqlx b/definitions/gold/ALL_INTERACRIONS_SUM.sqlx index 0a5ed32..498d52a 100644 --- a/definitions/gold/ALL_INTERACRIONS_SUM.sqlx +++ b/definitions/gold/ALL_INTERACRIONS_SUM.sqlx @@ -5,7 +5,7 @@ config { description: "All interactions table for CALLS and DIGITAL" } -select TIMESTAMP, +select TIMESTAMP_MILLISECOND, DATE, HOUR_OF_DAY, MONTH, @@ -15,7 +15,7 @@ select TIMESTAMP, 1 INTERACTIONS from ${ref("CALLS")} union all -select TIMESTAMP, +select TIMESTAMP_MILLISECOND, DATE, HOUR_OF_DAY, MONTH,