Skip to content
+

Combine PostgreSQL with Google Sheets: system data plus targets and costs

Orders, customers and transactions usually live in the PostgreSQL database behind your sales software or internal app, while sales targets, budgets, unit costs and code mapping tables are kept in Google Sheets by the sales and accounting teams. DataxLand loads the Postgres tables (full, incremental or CDC) and reads the spreadsheet on schedule, then joins them in one model. The result is gross profit with real cost of goods, quota attainment and spend against budget, computed from live system data rather than an old CSV export.

Free plan with no time limit · No card required · Sample workspace ready in minutes

Why combine

  • Targets and budgets never live in the transactional database; they live in spreadsheets.
  • Exporting CSV from the database and joining with VLOOKUP is error-prone and always behind the real data.
  • CDC from Postgres plus scheduled spreadsheet refreshes keeps dashboards close to real time.

Metrics you only get by combining

MetricHow it is computed
Cost of goods soldUnits sold in Postgres × cost per SKU in Google Sheets
Contribution marginNet revenue − cost of goods − marketplace fees − payment fees − seller-paid shippingFees found in the database are used; missing ones stay blank and Si flags them.
COGS coverageOrder line revenue with a known cost ÷ total order line revenue
Quota attainmentWon amount ÷ sales targetNeeds an opportunity table in the database or CRM, plus a target sheet.

Standard metrics from the analytics packs

Once both sources map to the same model, these metrics run on the joined data with one definition.

MetricDefinitionUnit
Cost of goods soldQuantity times unit cost on the order date (half-open validity interval). SKUs without a cost count as 0; see COGS coverage. Returned lines do not reverse their COGS.Currency
Contribution marginNet revenue minus COGS, marketplace fees, payment fees, shipping and return costs (before advertising).= Net revenue - Cost of goods sold - Marketplace fees - Payment fees - Seller-paid shipping cost - Return costCurrency
COGS coverageShare of line revenue (after discounts) coming from SKUs that have a cost. Below 100% means the profit metrics are overstated.= line_net_with_cost / line_net_totalRatio (%)
Quota attainmentWon amount divided by sales target. Above 100% means the target is exceeded.= Won amount / Sales targetRatio (%)
Net revenueLine value after line discounts and allocated order vouchers, minus refunds to buyers. Refunds are deducted only here.Currency

What each source contributes

DataPostgreSQLGoogle Sheets
Orders, order lines, productsYesNo
Cost per SKUSometimesUsually
Targets, budgetsNoYes
Sync modeFull, incremental, CDCFull on every refresh

Steps

  1. 1

    Connect PostgreSQL

    Enter the host, database and a read-only user; choose the tables and the sync mode (full, incremental or CDC).

  2. 2

    Connect Google Sheets

    Paste the spreadsheet link and a service account key (share the spreadsheet with the service account email), or your own OAuth client details.

  3. 3

    Review Si's mapping

    Si investigates the Postgres tables with capped read-only queries and proposes the order, order line and product tables plus the cost and target sheets; you approve.

  4. 4

    Build and read the dashboards

    The profit, product and quota dashboards update on your refresh schedule; ask Si which SKUs have no cost yet.

Frequently asked questions

Does DataxLand write to my database?

No. Use a read-only user. When needed, Si only runs read queries within a cap on query count and cost; any query over the cap waits for a technical user to confirm. CDC needs replication permission and creates a replication slot.

What if the database is on a private network?

The server must be reachable from DataxLand over the public internet, usually with an IP allowlist and TLS. DataxLand does not connect to private network addresses.

Which plan can combine two sources?

The Free plan accepts a single Excel file. Combining two or more sources needs the Starter plan (up to 3 sources) or above; see pricing for the number of sources and the refresh schedule of each plan.

Dashboard templates that use this source

Connect PostgreSQL →Connect Google Sheets →Ask Si about your PostgreSQL data →Ask Si about your Google Sheets data →

Other combinations

Combine PostgreSQL and Google Sheets in minutes

Free plan with no time limit · No card required · Sample workspace ready in minutes