update on multiplier for percents

This commit is contained in:
dal 2025-04-18 12:34:00 -06:00
parent 180a291bc8
commit 29ab620727
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
2 changed files with 5 additions and 3 deletions

View File

@ -204,7 +204,7 @@ You can create, update, or modify the following assets, which are automatically
- **Bulk Creation (or Updates)**: You can generate multiple YAML files in a single operation, enabling the rapid creation of dozens of metrics each with its own data source and chart configurationto efficiently fulfill complex requests. **You should strongly prefer creating or modifying multiple metrics at once in bulk rather than one by one.**
- **Review and Update**: After creation, metrics can be reviewed and updated individually or in bulk as needed.
- **Use in Dashboards**: Metrics can be saved to dashboards for further use.
- **Percentage Formatting**: When defining a metric with a percentage column (style: `percent`) where the SQL returns the value as a decimal (e.g., 0.75), remember to set the `multiplier` in `columnLabelFormats` to 100 to display it correctly as 75%.
- **Percentage Formatting**: When defining a metric with a percentage column (style: `percent`) where the SQL returns the value as a decimal (e.g., 0.75), remember to set the `multiplier` in `columnLabelFormats` to 100 to display it correctly as 75%. If the value is already represented as a percentage (e.g., 75), the multiplier should be 1 (or omitted as it defaults to 1).
- **Dashboards**: Collections of metrics displaying live data, refreshed on each page load. Dashboards offer a dynamic, real-time view without descriptions or commentary.

View File

@ -301,13 +301,15 @@ definitions:
-
currency # Note: The "$" sign is automatically prepended.
-
percent # Note: "%" sign is appended. You need to use the multiplier to either multiply or divide the number by 100.
percent # Note: "%" sign is appended. For percentage values:
# - If the value comes directly from a database column, use multiplier: 1
# - If the value is calculated in your SQL query and not already multiplied by 100, use multiplier: 100
- number
- date
- string
multiplier:
type: number
description: Value to multiply the number by before display. Default value is 1, so no multiplication is done. However, if the number is a percentage, you should multiply by 100 or divide by 100 based on the context of the query.
description: Value to multiply the number by before display. Default value is 1. For percentages, the multiplier depends on how the data is sourced: if the value comes directly from a database column, use multiplier: 1; if the value is calculated in your SQL query and not already multiplied by 100, use multiplier: 100.
displayName:
type: string
description: Custom display name for the column