# Start from a calculation template

> Formulas suggested for your own fields, plus 11 common templates for growth, ratios, date gaps and buckets, filled in with your fields in one click.

Analyze · 7 min read · Updated 2026-11-22

Templates give you a working formula without writing one. Golden reads your fields, suggests the calculations that fit them, and fills in field names for you.

![The Templates tab: Suggested for your data with Profit Margin %, Revenue per Unit, Profit per Unit and Discount Amount rated high, Net Sales and Is Profitable rated medium, and Common templates from Year-over-Year Growth % to Business Days](https://app.goldenanalytics.com/api/help/public-image?object=b5c9d06b-0741-41cc-b4e1-4c2b128da243%2F1795386133962-calculation-templates--01-templates.png)

### When to use it

- **Your first calculated field.** A new analyst clicks **Profit Margin %** under **Suggested for your data** and has a correct ratio in one click.
- **Shipping and fulfillment.** An ops lead picks **Days Between Dates** and Golden fills in Order Date and Ship Date on its own.
- **A quick segmentation.** A sales manager starts from **Value Bucket** and edits the thresholds to fit their order sizes.

If you're about to type a formula that sounds like a template name, start from the template.

### Getting started

1. Open the calculation editor (**Fields** tab, **New calculated field**).
2. Click the **Templates** tab on the right. A dot on the tab means there are suggestions for your data.
3. Click a template. Golden fills in the **Field name**, the **Formula** with your fields, and a matching **Display format**.
4. Check the preview, edit if needed, and click **Create field**.

![The Days Between Dates template applied: the field name Days Between Dates, the formula DURATION(Order Date, Ship Date, "days") marked Valid, and a preview showing 4 days, 7 days and 1 day for real orders](https://app.goldenanalytics.com/api/help/public-image?object=b5c9d06b-0741-41cc-b4e1-4c2b128da243%2F1795386134963-calculation-templates--02-template-applied.png)

### Suggested for your data

Golden looks at your field names and types and suggests formulas that make sense for them. On a sales dataset with Sales, Profit, Quantity and Discount, you get **Profit Margin %**, **Revenue per Unit**, **Profit per Unit**, **Discount Amount**, **Net Sales** and **Is Profitable**.

Each suggestion is rated **high** or **medium**, for how sure Golden is that it fits your data. Your list depends on your fields, so it changes from dataset to dataset.

### Common templates

These 11 are always there. Golden swaps in your fields where it can match them; check the formula before you save.

| Template | What it does | Formula it starts from |
| --- | --- | --- |
| **Year-over-Year Growth %** | Percentage change from previous period | `SAFE_DIVIDE([current] - [previous], [previous])` |
| **Grand Total** | Total across all rows | `SUM([measure])` |
| **Ratio of totals (SUM A / SUM B)** | Totals divided, like revenue per order. Adds up first, then divides | `SAFE_DIVIDE(SUM([numerator]), SUM([denominator]))` |
| **Ratio per row (A / B)** | Divides within each row, then aggregates | `SAFE_DIVIDE([numerator], [denominator])` |
| **Percentage Change** | Difference as percentage of base value | `SAFE_DIVIDE([new value] - [old value], [old value])` |
| **Days Between Dates** | Number of days between two date fields | `DURATION([start date], [end date], "days")` |
| **Hours Between Dates** | Number of hours between two date fields | `DURATION([start date], [end date], "hours")` |
| **Business Days** | Working days excluding weekends | `BUSINESSDAYS([start date], [end date])` |
| **Absolute Duration** | Always positive duration between dates | `DURATION([start date], [end date], "days", true)` |
| **Conditional Value** | Return different values based on condition | `IF([measure] > 0, [measure], 0)` |
| **Value Bucket** | Categorize into High/Medium/Low | `IF([measure] >= 1000, "High", IF([measure] >= 100, "Medium", "Low"))` |

The percentage templates set the display format to **Percentage**, and the date templates set it to **Duration**, so results read as "18.4%" or "4 days" straight away.

> **Tip:** For a margin or rate on a chart, you almost always want **Ratio of totals**: total profit divided by total sales. **Ratio per row** works out each row's ratio first, and the chart then averages those, which weights a $5 order the same as a $5,000 one.

### Edit after you apply

A template is a starting point. Change the thresholds in **Value Bucket** to fit your data, or use **Refine with AI** under the formula ("make the buckets 100 and 500"). See [Write and check a calculation](https://goldenanalytics.com/docs/write-and-check-a-calculation).

If a template couldn't match one of your fields, it leaves an uppercase placeholder like `[MEASURE]`. The formula won't be **Valid** until you replace it with a real field.

### Do it from chat

```
Add a profit margin field
```

```
Add a field for business days between order date and ship date
```

### FAQ

**Why don't I see any suggestions for my data?** Suggestions need fields Golden can recognize, like sales, cost, quantity or two dates. The common templates are always there.

**What does high or medium mean?** How confident Golden is that the suggestion fits your fields. Both are worth checking in the preview.

**Does a template change my data?** No. It fills in the editor. Nothing is created until you click **Create field**.

Source: https://goldenanalytics.com/docs/start-from-a-calculation-template
