ACUMATICA

Acumatica Data Warehouse Integration Guide

January 25, 2024 20 min read

Introduction

Integrating Acumatica ERP with a data warehouse enables powerful business intelligence capabilities, advanced analytics, and comprehensive reporting. This guide covers the complete ETL (Extract, Transform, Load) process for building a robust data warehouse solution.

Organizations leverage data warehouse integration to consolidate data from multiple sources, perform trend analysis, and make data-driven business decisions.

Integration Architecture

A typical Acumatica data warehouse integration consists of:

  • Source System - Acumatica ERP database
  • ETL Layer - Data extraction, transformation, and loading processes
  • Staging Area - Temporary storage for processed data
  • Data Warehouse - Centralized repository (SQL Server, Snowflake, BigQuery)
  • BI Layer - Reporting and analytics tools

Data Extraction

Extract data from Acumatica using multiple approaches:

Direct Database Access

-- Extract AR Invoices
SELECT 
    RefNbr,
    CustomerID,
    CustomerName,
    DocDate,
    DueDate,
    DocDesc,
    CuryOrigDocAmt,
    CuryID,
    Status
FROM AR301000
WHERE DocDate >= @StartDate;

REST API Extraction

// Acumatica API client for data extraction
class AcumaticaDataExtractor {
    async extractInvoices(startDate, endDate) {
        const endpoint = '/api/data/AR301000';
        const params = {
            '$filter': `DocDate ge ${startDate} and DocDate le ${endDate}`,
            '$expand': 'Details'
        };
        
        return await this.client.get(endpoint, params);
    }
}

Change Data Capture

-- Track changes using timestamp
SELECT * FROM AR301000 
WHERE LastModifiedDateTime > @LastSyncTime
AND NoteID NOT IN (SELECT NoteID FROM ProcessedRecords);

Data Transformation

Transform raw Acumatica data into warehouse-friendly formats:

Data Cleansing

-- Standardize customer names
UPDATE staging_customers
SET 
    CustomerName = TRIM(CustomerName),
    CustomerID = UPPER(CustomerID),
    Country = CASE Country
        WHEN 'USA' THEN 'US'
        WHEN 'UK' THEN 'GB'
        ELSE Country
    END;

Dimension Tables

-- Create customer dimension
INSERT INTO dim_customer (CustomerKey, CustomerID, CustomerName, 
    CustomerClass, CreditLimit, Terms, Territory, InsertDate)
SELECT 
    NEWID() AS CustomerKey,
    CustomerID,
    CustomerName,
    CustomerClass,
    CreditLimit,
    TermsID,
    TerritoryID,
    GETDATE()
FROM staging_customers
WHERE NOT EXISTS (
    SELECT 1 FROM dim_customer 
    WHERE dim_customer.CustomerID = staging_customers.CustomerID
);

Fact Tables

-- Create invoice fact table
INSERT INTO fact_invoices (InvoiceKey, CustomerKey, DateKey, 
    InvoiceNumber, Amount, TaxAmount, Status)
SELECT 
    NEWID() AS InvoiceKey,
    (SELECT CustomerKey FROM dim_customer WHERE CustomerID = i.CustomerID) AS CustomerKey,
    (SELECT DateKey FROM dim_date WHERE Date = i.DocDate) AS DateKey,
    i.RefNbr,
    i.CuryOrigDocAmt,
    i.CuryTaxAmt,
    i.Status
FROM staging_invoices i;

Data Loading

Load transformed data into the warehouse:

Full Load

-- Full reload of customer dimension
TRUNCATE TABLE dim_customer;

INSERT INTO dim_customer
SELECT * FROM staging_customers;

Incremental Load

-- Incremental load with SCD Type 2
INSERT INTO dim_customer
SELECT 
    NEWID() AS CustomerKey,
    CustomerID,
    CustomerName,
    CustomerClass,
    GETDATE() AS ValidFrom,
    '9999-12-31' AS ValidTo,
    1 AS IsCurrent
FROM staging_customers c
WHERE NOT EXISTS (
    SELECT 1 FROM dim_customer d
    WHERE d.CustomerID = c.CustomerID AND d.IsCurrent = 1
    AND d.CustomerName = c.CustomerName
);

-- Update expired records
UPDATE dim_customer
SET ValidTo = GETDATE(), IsCurrent = 0
WHERE CustomerID IN (
    SELECT c.CustomerID
    FROM staging_customers c
    INNER JOIN dim_customer d ON c.CustomerID = d.CustomerID
    WHERE c.CustomerName <> d.CustomerName
    AND d.IsCurrent = 1
);

BI Tool Integration

Connect your data warehouse to popular BI tools:

  • Power BI - Direct query and import modes
  • Tableau - Live connections and extracts
  • Looker - LookML modeling
  • Custom Dashboards - Web-based visualizations

Power BI Connection

// Power BI API integration
const powerBiClient = new PowerBIClient(credentials);
const dataset = await powerBiClient.datasets.postDataset({
    name: "Acumatica Analytics",
    tables: [{
        name: "fact_invoices",
        columns: [
            { name: "InvoiceKey", dataType: "Guid" },
            { name: "InvoiceNumber", dataType: "String" },
            { name: "Amount", dataType: "Double" }
        ]
    }]
});

Best Practices

  • Schedule wisely - Run ETL during off-peak hours
  • Use incremental loads - Only process changed data
  • Implement logging - Track ETL execution and errors
  • Data validation - Verify data integrity at each stage
  • Error handling - Implement robust retry and rollback mechanisms
  • Monitor performance - Track ETL execution times
  • Document transformations - Maintain data lineage

Summary

Acumatica data warehouse integration enables powerful analytics and reporting capabilities. By implementing a robust ETL pipeline, you can transform raw ERP data into actionable business insights.

For more Acumatica guides, check out Acumatica Advanced Reporting and Acumatica REST API Integration.