OWOX Data Marts — the new open-source analytics platform. Learn more at docs.owox.com

2. Transactions_stg (data preparation: _temp_transactions)

NEW documentation: This article covers setup for OWOX BI. For the latest guides on setting up FREE connectors and Data Marts, visit the new OWOX Data Marts documentation.

NoteThis transformation contains intermediate data preparation and creates a table ‘_temp_transactions’. This table you will use in the following transformations.

Use the SQL code below and change {{projectId}} and {{datasetName}} to your own.

#Intermediate table with transactions
WITH
  #Set the date range for the calculation
    dates as 
      ( 
        SELECT
          '20220901' AS date_start,
          '20220930' AS date_end, 
      )

SELECT 
  transactions.* 
FROM 
  dates as d, `{{projectId}}.{{datasetName}}._temp_objects` 
WHERE 
  date BETWEEN PARSE_DATE('%Y%m%d', d.date_start) AND PARSE_DATE('%Y%m%d', d.date_end) and transactions.date is not null

 

You will get the data in the table '_temp_transactions' with the schema below:

Field name Type  
date DATE  
sessionId STRING  
time INTEGER  
transactionId STRING  
transactionRevenue FLOAT  

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.