# Data Mart

<figure><img src="https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2FF2egqWKCkDZAJSMOEFNz%2Fimage.png?alt=media&#x26;token=f3fc830f-6278-41b6-8947-bef64768f815" alt=""><figcaption></figcaption></figure>

## Project Overview

To build a **modular and scalable Data Mart** within **Gaio DataOS**, organizing operational data by domain (Customers, Orders, Products, and Order Items), enabling descriptive, operational, and predictive analytics.

***

## Development Stages

### 1.  Validation and Process Trigger

<figure><img src="https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2FW4hFpcSBKK7yiGnloD1U%2Fimage.png?alt=media&#x26;token=400c8248-aa38-474f-b850-a8021c4b5d25" alt=""><figcaption></figcaption></figure>

* The project starts with an automatic data update check.
* SQL Control Table creates tmp\_tb\_control\_data\_update.
* Flow:
  * `tmp_tb_control_data_update`: checks for updates
  * `tb_control_data_update`: stores execution status
  * If new data is detected, the main extraction flow is triggered automatically.

***

### 2.  Data Extraction

<figure><img src="https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2FF2egqWKCkDZAJSMOEFNz%2Fimage.png?alt=media&#x26;token=f3fc830f-6278-41b6-8947-bef64768f815" alt=""><figcaption></figcaption></figure>

* Data is extracted from **data sources**, **CSV files** or **APIs at Gaio**.
* Uses **Builder tasks** for:
  * Data transformation
  * Handling nulls and errors
  * Standardizing formats
* Intermediate results are stored in **temporary tables (`tmp_`)**.
* Final consolidation and versioning are done in **final tables (`tb_`)**.

***

### 3. Domain-Based Structure

Each domain follows this modular structure:

```
Source → Staging Builder → Temporary Table (`tmp_`) → Final Builder → Final Table (`tb_`)
```

***

#### 3.1  Customers Domain

<figure><img src="https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2FCWfZzFN9zBiQvdFVc2UK%2Fimage.png?alt=media&#x26;token=d792d8bb-2862-4333-b968-a3a8e20d549a" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`customers`)
* Steps:
  * Filter out invalid data
  * Normalize and enrich information
  * Build `tmp_customers`, then publish to `tb_customers`

***

#### 3.2  Orders Domain

<figure><img src="https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2FBVWaZCPakBGIh3vOuEPY%2Fimage.png?alt=media&#x26;token=2e880c72-5a6b-43cd-a8f6-3e2da3f335be" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`orders`)
* Steps:
  * Calculate totals, shipping fees, estimated delivery
  * Status and failure normalization
  * `tmp_orders` → `tb_orders`

***

#### 3.3  Products Domain

<figure><img src="https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2Ft0uh7gE1S3O7Aws8UFIF%2Fimage.png?alt=media&#x26;token=f0b46b7a-b89e-4f88-8f61-0b7a289887b6" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`products`)
* Steps:
  * Enrich with category and availability
  * Add flags for discontinued products
  * `tmp_products` → `tb_products`

***

#### 3.4 Order Items Domain

<figure><img src="https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2F9EOb7AiGhoDhBu2EPRFt%2Fimage.png?alt=media&#x26;token=e4cc2059-6f8e-4f44-9665-f9ce9ef47e35" alt=""><figcaption></figcaption></figure>

* Source: PostgreSQL (`order_items`)
* Steps:
  * Clean up nulls and data types
  * Calculate taxes, discounts, unit values
  * `tmp_order_items` → `tb_order_items`

***

### &#x20;Technologies Used

* **Gaio DataOS** as the core platform
* **Visual ETL** with Builder, Form, Content, and SQL tasks
* **Temporary Tables (`tmp_`)** for staging and audit
* **Final Tables (`tb_`)** for downstream use
* **Dynamic Parameters** for context handling and automation
* **Conditional logic** to manage execution flow
* Ready for integration with **dashboards, AI and automation flows**

***

### Expected Outcomes

* Solid and auditable data processing pipelines
* Ability to rerun specific domains independently
* Accelerated dashboard development
* Reusable components for future projects
* Improved data trust and governance for business users
* Ready-to-use structure for **forecasting, clustering, and churn models**

***

### Download this project

{% file src="<https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2FJcREgrU4JEqBwcBEE0Kg%2FTables.zip?alt=media&token=7509b937-14bb-4c8a-bd5c-69438d0cca46>" %}

{% file src="<https://1671598980-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0muDd0LkZG6CmTQvGQ4D%2Fuploads%2F1kaD6gnFV9t8REyoq4Ox%2Fbkp_app-52_25-07-29_17-07-19.zip?alt=media&token=dacda559-4ee8-4428-9737-8cde1e6dc035>" %}
