This article is part of the Guide to Insightly Dashboards
If you want to learn how to create a custom calculated field that will appear in your records, read How to create a custom calculated field instead.
With a calculated field, you can create a new value from data that already exists in Insightly. This new field will be saved to your Values list and can be used in your charts. For example, your Average Order Value is calculated using the formula: SUM(“Sale”/“Orders”).
You'll use T-SQL (Transact-SQL) to build a calculated field. If you're not familiar with SQL or haven't created similar formulas in Excel, you might want to get assistance from someone who is more familiar with these things.
To create a calculated field:
- From the dashboard card edit page, click Add Calculated Field.
- Enter a name for the field. When you save the new field, this name will appear in the Categories or Values list above with an equals sign (=) in front of it.
- Enter a formula in the Formula field. You can build a formula by double-clicking any item in the Dataset or Functions lists, typing directly in the field, or copying and pasting a provided formula, such as the examples at the bottom of this article.
Select any function to learn about it. Each function includes a description, examples, and a link to more information about how to use it.
Click Save And Close.
Your new field will now appear in the Categories or Values list with an equals sign in front of it.
Here are some common calculated fields to get you started:
SUM(CASE WHEN "Current State" = 'WON' THEN 1 ELSE 0 END)
YoY Calculated Field
FORMAT(CONVERT(datetime, "Lead Created"), 'yyyy')
Win Rate (Opportunities Won / Total Opportunities)
CAST(SUM(CASE WHEN "Current State" = 'WON' THEN 1 ELSE 0 END) AS DECIMAL(10,2)) / CAST(COUNT("Record ID") AS DECIMAL(10,2))
When a division is performed, the numerator and denominator need to be converted to decimals before performing the division. Either a CONVERT or CAST function can be used to convert the operands to decimals.
CAST(COUNT("Record ID") AS DECIMAL(10,2))
Change dates to Month, Year format
FORMAT(CONVERT(datetime, "Lead Created"), 'yyyy/MM')
Change date field "Lead Created" to relevant date field
Change dates to Month, Day, Year format
FORMAT(CONVERT(DATETIME, "Opportunity Created"), 'MM/dd/yyyy')
Change date field "Opportunity Created" to relevant date field