---
title: "Troubleshooting"
description: "This topic describes errors that can occur when working with formulas in Lucanet xP&A. A possible solution is described for all errors."
source_url: https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-andedit-formulas/troubleshooting
language: en
last_updated: 2023-08-16
---
# Troubleshooting

## Overview

This topic describes errors that can occur when working with formulas in xP&A. A possible solution is described for all errors.

## Errors in xP&A Formulas

If you are getting an error with a variable, you can hover over the **Error** or the variable and xP&A will explain the cause of the error:

Displaying an error in a formula

## Common Errors

The following error messages can be displayed for formulas in xP&A:

| Error Message | Description |
|---------|---------|
| A function has an incorrect number of arguments. | You used too many or too few parameters to call a function. **How do I fix it?** Check the chapter on [Functions](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-andedit-formulas/functions.md) in our documentation and use the correct number of arguments in your formula. |
| Aggregation set to None. | You use an aggregated variable in your formula, but the variable's dimension aggregation is set to [None](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-edit-variables.md). **How do I fix it?** Change the variable's [dimension aggregation](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/using-dimensions/aggregating-dimensions.md) or do not aggregate the variable in your formula. |
| Dimension error. | There is some inconsistency in the [variable's dimensions](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/using-dimensions.md). |
| Data error. | The data dimensionality does not match the variable dimensionality. This can happen if you explicitly apply a dimension and connect the variable to a data item that is not broken down by that dimension. **How do I fix it?** Make sure the data item and the variable have the same [dimension](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/using-dimensions.md). Either add the dimension to your data source, or remove the dimension from the variable. |
| It is not possible to use date functions for time aggregations. | Currently, calling date to map monthly, quarterly, annual, or exhaustive timespans to an exact date is undefined behaviour. |
| Variable was expected. | You did not provide a variable when you called a function that only works with variables, e.g. **is_data**. **How do I fix it?** Use a variable as the argument when calling the function. |
| Invalid number error. | Your formula results in an invalid number (e.g. division by zero, sqrt(-2)). **How do I fix it?** Correct the formula, or use the **if_error** function to return an alternative value (e.g. ”Z”) instead of an error. |
| Invalid syntax in formula. | You did not use the correct syntax in your formula, e.g. you forgot the "else" in an if-statement. **How do I fix it?** Check the function documentation in the help menu or on the functions page here. |
| Mappings to a dimension are ambiguous. | There is more than one path from one dimension to another dimension. E.g. Dimension A → Dimension B → Dimension C and Dimension A → Dimension D → Dimension C. **How do I fix it?** Remove one of the dimension mappings in the data table. |
| The linked variable does not exist. | This can happen if you import a [variable from a linked model](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-edit-variables/referencing-variables-from-linked-models.md), and then delete the original variable in the linked model. **How do I fix it?** Create and import the variable again. |
| There is a cyclical dependency in this formula. | Your variables cyclically depend on each other, e.g. A depends on B and B depends on A. **How do I fix it?** Change the referenced timesteps of the variables. E.g. if A depends on B, then B can depend on the previous value of A. |
| Unknown expression. | You tried to use a function that does not exist in xP&A. **How do I fix it?** Check out the [Functions](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-andedit-formulas/functions.md) chapter to see the list of supported functions. |
| Unknown variable. | Your formula uses a variable that does not exist in the model. **How do I fix it?** Import the missing variable from a different model or use a different variable in your formula. |
| You need to aggregate a span using min(), avg(), ... | A span is an array of values, e.g. Variable\[all\] or Variable\[0:t\]. The result of your formula has to be a single number and cannot be a span. **How do I fix it?** Aggregate the span into a single number using an [aggregation function](https://support.lucanet.cloud/en/documentation/xp-a---extended-planning-and-analysis/modeling-your-data/create-edit-variables/aggregation-functions.md) like sum(Variable\[all\]) or min(Variable\[0:t\]). |
