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
| Metric | How it is computed |
|---|---|
| Cost of goods sold | Units sold in Postgres × cost per SKU in Google Sheets |
| Contribution margin | Net 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 coverage | Order line revenue with a known cost ÷ total order line revenue |
| Quota attainment | Won 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.
| Metric | Definition | Unit |
|---|---|---|
| Cost of goods sold | Quantity 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 margin | Net 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 cost | Currency |
| COGS coverage | Share 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_total | Ratio (%) |
| Quota attainment | Won amount divided by sales target. Above 100% means the target is exceeded.= Won amount / Sales target | Ratio (%) |
| Net revenue | Line value after line discounts and allocated order vouchers, minus refunds to buyers. Refunds are deducted only here. | Currency |
What each source contributes
| Data | PostgreSQL | Google Sheets |
|---|---|---|
| Orders, order lines, products | Yes | No |
| Cost per SKU | Sometimes | Usually |
| Targets, budgets | No | Yes |
| Sync mode | Full, incremental, CDC | Full on every refresh |
Steps
- 1
Connect PostgreSQL
Enter the host, database and a read-only user; choose the tables and the sync mode (full, incremental or CDC).
- 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
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
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