74 lines
1.8 KiB
SQL
74 lines
1.8 KiB
SQL
{{ config(
|
|
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
|
|
schema = "unibag",
|
|
tags = [ "nested" ]
|
|
) }}
|
|
-- Final base SQL model
|
|
-- depends_on: {{ ref('users_statistic_ab3') }}
|
|
select
|
|
_airbyte_users_hashid,
|
|
cashtotal,
|
|
cashpending,
|
|
cashcashback,
|
|
cashgivegift,
|
|
cashrejected,
|
|
taxtotalcash,
|
|
totalgiftbox,
|
|
totaltickets,
|
|
cashcancelled,
|
|
cashdelivered,
|
|
cashremaining,
|
|
customertotal,
|
|
totalcartitem,
|
|
withdrawtotal,
|
|
cashdelivering,
|
|
taxcashpending,
|
|
withdrawpending,
|
|
withdrawsuccess,
|
|
revenuelastmonth,
|
|
totalsalesuccess,
|
|
transactiontotal,
|
|
withdrawrejected,
|
|
cashwithdrawtotal,
|
|
cashwaitingapprove,
|
|
transactionpending,
|
|
transactionsuccess,
|
|
cashwithdrawpending,
|
|
cashwithdrawsuccess,
|
|
highestmonthlysales,
|
|
transactionrejected,
|
|
cashwithdrawrejected,
|
|
teambonuspendingcash,
|
|
teambonussuccesscash,
|
|
transactiondelivered,
|
|
cashpaymentprocessing,
|
|
transactiondelivering,
|
|
eventrewardpendingcash,
|
|
eventrewardsuccesscash,
|
|
transactioncashpending,
|
|
voucherbonuspendingcash,
|
|
voucherbonussuccesscash,
|
|
eventreferralpendingcash,
|
|
eventreferralsuccesscash,
|
|
promotionbonuspendingcash,
|
|
promotionbonussuccesscash,
|
|
transactionwaitingapprove,
|
|
commissiontransactiontotal,
|
|
membershipbonuspendingcash,
|
|
membershipbonussuccesscash,
|
|
commissiontransactionpending,
|
|
transactionpaymentprocessing,
|
|
commissiontransactioncashback,
|
|
commissiontransactionrejected,
|
|
commissiontransactiondelivered,
|
|
commissiontransactiondelivering,
|
|
revenuethismonth_aibyte_transform,
|
|
_airbyte_ab_id,
|
|
_airbyte_emitted_at,
|
|
{{ current_timestamp() }} as _airbyte_normalized_at,
|
|
_airbyte_statistic_hashid
|
|
from {{ ref('users_statistic_ab3') }}
|
|
-- statistic at users/statistic from {{ ref('users') }}
|
|
where 1 = 1
|
|
|