# Formula Gallery

Each chart in Spotlight contains a formula to calculate the values shown. With the Formula Gallery, you can access and amend these formulae and save them for later use in your organisation or practice.

## Formula types

There are three different formula types available.

**Default**- The standard formulae available in Spotlight. The default formulae are available in all organisations.**Practice**- A formula you've created and made available to all of your organisations.**Organisation**- A formula you've created and made available to only the current organisation.

## Formula hierarchy

With the Formula Gallery, you can create formulae with the same name as those that already exist in Spotlight. If you have more than one formula with the same name, these are used in a specific order.

**Organisation**- Formulae you create for the specific organisation always take priority for that organisation. If you save a formula for a specific organisation, and this uses the same name as a Practice or Default Formula, the organisation copy is used.**Practice**- Formulae you create for your practice take priority over default formulae. If you save a formula for the practice, and it uses the same name as a default formula, the practice copy is used**unless**a particular organisation has its own copy of the formula.**Default**- If you haven't created a specific Organisation or Practice formula, the default formula is used. You can override default formulae at either the Organisation or Practice level, by saving a new formula with the same name.

If you create your own custom formulae, and later delete them, the Default formulae will be used again.

## Create a new formula

**Note: **You can also create a formula from within most standard charts and within custom charts.

### For the whole Practice

**Note:** To be able to save formulae for use in the whole practice, you must have the right user role. If you can't see the Formula Gallery option when you access the Settings option for your practice, or don't have the option to save a practice formula, you don't have the right user role to work with Practice level formulae.

- From the main Spotlight screen, open the Settings menu then choose Formula Gallery.
- Click Create New Formula, then use the formula builder to create the required formula.
- Click Save As, then enter a name for your formula.
**Note:**If you enter a name already in use for a default formula, your own formula takes precedence in all organisations. If you enter a name already in use for another custom formula, the existing one is replaced. - If required, enter formula tags.
- To save the formula, click Save.

Your new formula appears on the list as a Practice formula and is available to use in charts in all of your organisations.

### For a single Organisation

- From the main Spotlight screen, click the Settings link under the organisation name.
- Click the Formula Gallery tab, then click Create New Formula.
- Use the formula builder to create the required formula, then click Save As.
- From the Available to drop-down list, choose Organisation. If you choose Practice, the formula is available to the whole Practice.
- Enter a name for your formula.
**Note:**If you enter a name already in use for a default formula, your own formula takes precedence in this organisation. If you enter a name already in use for another custom formula, the existing one is replaced. - If required, enter formula tags.
- To save the formula, click Save.

Your formula appears on the list as an Organisation formula and is available to use in charts in this organisation.

## Edit a formula

**Note: **You can also edit a formula directly from within most standard charts and within custom charts.

- From the main Spotlight screen, open the Settings menu then choose Formula Gallery.
- Locate the formula you want to amend, then click the Copy and Edit button.
- Use the formula builder to amend the formula, then click Save As.
- Enter a name for your formula.
**Note:**If you enter a name already in use for a default formula, your own formula takes precedence. If you enter a name already in use for another custom formula, the existing one is replaced. - If required, enter formula tags.
- To save the formula, click Save.

## Delete a formula

**Note: **Once you delete a formula, this can't be undone. If you need the formula again, you must recreate it.

### To delete a Practice formula

- From the main Spotlight screen, open the Settings menu then choose Formula Gallery.
- Click the Delete button, then to continue, click Delete.

### To delete an Organisation formula

- From the main Spotlight screen, click the Settings link under the organisation name.
- Click the Formula Gallery tab, then click the Delete button.
- A confirmation message appears. To continue, click Delete.

## Formula tags

When you create a formula, you have the option to enter formula tags. You can use these later to search for the formulae you need. Simply enter the name of the tag into the search box.

**Note: **Formula tags can't contain spaces, so if you need to use more than one word you can separate them with an underscore.