DailyValueRule
You can use the DailyValueRule function to retrieve the daily value for a specified analysis parameter based on a daily value rule.
When to use
You can use this function within Analysis forms for nutritional calculations.
When not to use
You cannot use this function outside of equations.
Syntax
double DailyValueRule(string Param, string DailyValueCode)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Param | string | Optional | The name of the analysis parameter whose daily value is to be returned.
Note: You can use the empty string ("" ) to reference the current parameter in analysis context.
|
| DailyValueCode | string | Optional | The code of the Daily Value rule whose value is to be returned.
Note: If omitted or empty, the function uses the daily value rule of the current analysis object.
|
Return Value
The application returns the daily value of the specified parameter for the specified daily value rule as double.
Prerequisites
- These are used in equations.
- The daily value rules need to be configured in the system.
Examples
- Example 1
-
Get daily value using current rule on an analysis object.
double dv = DailyValueRule();
- Description
- This example returns the daily value of the current parameter for DailyValueRule.
- Example 2
-
Get daily value for specific rule.
double dvr = DailyValueRule("", "CANADA");
- Description
- This example returns the daily value of the current parameter in the analysis calculation for a daily value rule whose code is CANADA.
- Example 3
-
Get daily value for specific rule and parameter.
double dvr = DailyValueRule("CALCIUM", "CANADA");
- Description
- This example returns the daily value of CALCIUM for a daily value rule whose code is CANADA.