Lenguaje de fórmulas
Valores vacíos
Qué pasa cuando un campo está vacío, no existe o no es un número, y cuándo el resultado queda vacío.
Las reglas
| Situación | Resultado |
|---|---|
| Un campo vacío dentro de SUM, AVG, MIN, MAX o MEDIAN | Se ignora. |
| Un campo vacío en una operación (+ - * /) | Vale 0. |
| SUM sin ningún valor | 0 |
| AVG, MIN, MAX o MEDIAN sin ningún valor | Vacío |
| COUNT de una lista vacía | 0 |
| División entre cero | Vacío, sin error. |
Un campo de texto con un número ("12") | Se lee como número. |
| Un campo de texto sin número | Las funciones numéricas lo ignoran. |
| Un campo que no existe en la issue | Como si estuviera vacío. |
Ejemplos
| Fórmula | Datos | Resultado |
|---|---|---|
SUM(children.{Horas}) | Hijas con 3, vacío y 5 | 8 |
AVG(children.{Horas}) | Hijas con 3, vacío y 5 | 4 (el vacío no cuenta) |
AVG(children.{Horas}) | Sin hijas | Vacío |
VAL({Presupuesto}) - SUM(children.{Gasto}) | Presupuesto vacío, gasto 200 | -200 |
SUM(children.{Horas}) / COUNT(children) | Sin hijas | Vacío (división entre cero) |
Cuándo usar MIN o MAX con un 0
Si prefieres ver 0 en lugar de vacío cuando no hay datos, añade un 0 como valor extra: MAX(children.{Riesgo}, 0)
devuelve 0 si ninguna hija tiene riesgo. Con AVG no lo hagas: el 0 contaría en la media.
Formula language
Empty values
What happens when a field is empty, missing or not a number, and when the result ends up empty.
The rules
| Situation | Result |
|---|---|
| An empty field inside SUM, AVG, MIN, MAX or MEDIAN | Skipped. |
| An empty field in arithmetic (+ - * /) | Counts as 0. |
| SUM with no values | 0 |
| AVG, MIN, MAX or MEDIAN with no values | Empty |
| COUNT of an empty list | 0 |
| Division by zero | Empty, no error. |
A text field holding a number ("12") | Read as a number. |
| A text field without a number | Numeric functions skip it. |
| A field that doesn’t exist on the issue | Treated as empty. |
Examples
| Formula | Data | Result |
|---|---|---|
SUM(children.{Hours}) | Children with 3, empty and 5 | 8 |
AVG(children.{Hours}) | Children with 3, empty and 5 | 4 (the empty one is skipped) |
AVG(children.{Hours}) | No children | Empty |
VAL({Budget}) - SUM(children.{Spent}) | Budget empty, spent 200 | -200 |
SUM(children.{Hours}) / COUNT(children) | No children | Empty (division by zero) |
When to use MIN or MAX with a 0
If you'd rather see 0 than empty when there's no data, add a 0 as an extra value: MAX(children.{Risk}, 0)
returns 0 when no child has a risk. Don't do this with AVG: the 0 would count in the average.
¿No encuentras algo? Escríbenos aCan't find something? Write to contacto@fluxor-tech.com · Ver la ficha del productoSee the product page