mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 12:24:04 +00:00
replaced new fct orders table
This commit is contained in:
@@ -7,7 +7,7 @@ WITH companies AS (
|
||||
),
|
||||
|
||||
transaction_orders AS (
|
||||
SELECT * FROM {{ ref('fct_exchange__transaction_orders') }}
|
||||
SELECT * FROM {{ ref('fct_exchange__daily_orders') }}
|
||||
),
|
||||
|
||||
company_identity_documents AS (
|
||||
@@ -54,22 +54,20 @@ clean_company_bookings AS (
|
||||
ON (bookings.company_id = remove_supplier_company.company_id)
|
||||
),
|
||||
|
||||
|
||||
company_first_time_order_date AS (
|
||||
SELECT
|
||||
transaction_order_id,
|
||||
order_id,
|
||||
company_id,
|
||||
order_created_datetime
|
||||
|
||||
FROM clean_company_transaction_orders
|
||||
|
||||
WHERE
|
||||
is_first_time_company_completed = '1'
|
||||
is_first_time_order_company_completed = 1
|
||||
),
|
||||
|
||||
|
||||
|
||||
--start defind funnel activity
|
||||
--start define funnel activity
|
||||
repeat_completed_order_after_60days_activities AS (
|
||||
SELECT
|
||||
clean_company_transaction_orders.company_id,
|
||||
@@ -121,7 +119,7 @@ first_time_order_completed_activities AS (
|
||||
FROM clean_company_transaction_orders
|
||||
|
||||
WHERE
|
||||
clean_company_transaction_orders.is_first_time_company_completed = 1
|
||||
clean_company_transaction_orders.is_first_time_order_company_completed = 1
|
||||
|
||||
GROUP BY
|
||||
clean_company_transaction_orders.company_id
|
||||
@@ -138,7 +136,7 @@ first_time_order_activities AS (
|
||||
FROM clean_company_transaction_orders
|
||||
|
||||
WHERE
|
||||
clean_company_transaction_orders.is_first_time_company = 1
|
||||
clean_company_transaction_orders.is_first_time_order_company = 1
|
||||
|
||||
GROUP BY
|
||||
clean_company_transaction_orders.company_id
|
||||
|
||||
Reference in New Issue
Block a user