Package Rule Properties and Methods
Properties for Custom Package Formulas
The following are properties for Custom Package Formulas.
Property |
Type |
Example Value |
SystemID |
string |
"T7A-001" C |
lientID |
string |
"001" |
Methods for Custom Package Formulas
The following table lists methods for custom package formulas.
Method |
Type |
Example Condition |
Note |
|||||||||||||||||||||
HasMetric(int metricID) |
bool |
HasMetric(1000) |
Determines whether a specific metric has a value from any measurement |
|||||||||||||||||||||
HasMetric(int metricID, int numMonths) |
bool |
HasMetric(1000, 12) |
Determines whether a specific metric has a value that is relevant within the specified period of time |
|||||||||||||||||||||
HasMetric(int metricID, int numMonths, string periodType) |
bool |
HasMetric(1100, 12, "C") |
Determines whether a specific metric has a value that is relevant within the specified period of time and where the period of the value has the specified type. Allowed period values:
|
|||||||||||||||||||||
Metric(int metricID) |
integer |
Metric(1000) |
Returns the value of the specified metric. Where a single measurement returns multiple values (distinct periods) for a single metric on a single SAP system, the value is the sum of all values. When used in a global context (within the TotalConsumption method), the value is the sum of all values across all SAP systems. |
|||||||||||||||||||||
Metric(int metricID, int numMonths) |
integer |
Metric(1000, 12) |
Returns the value of the specified metric for the specified period of time. Where a single measurement returns multiple values (distinct periods) for a single metric on a single SAP system, the value is the sum of all values. When used in a global context (within the TotalConsumption method), the value is the sum of all values across all SAP systems. |
|||||||||||||||||||||
Metric(int metricID, int numMonths, string periodType) |
integer |
Metric(1000, 12, "C") |
Returns the value of the specified metric for the specified period of time and where the period of the value has the specified type. Where a single measurement returns multiple values (distinct periods) for a single metric on a single SAP system, the value is the sum of all values. When used in a global context (within the TotalConsumption method), the value is the sum of all values across all SAP systems. Allowed period values:
|
|||||||||||||||||||||
Metric(int metricID) |
IEnumerable <int> |
Metrics(1000) Metrics(1000).Max() |
Returns a collection of all distinct values for the specified metric. Where a single measurement returns multiple values (distinct periods) for a single metric on a single SAP system, multiple values are returned. When used in a global context (within the TotalConsumption method), values for all distinct periods but summed up across all SAP systems are returned. |
|||||||||||||||||||||
Metrics(int metricID, int numMonths) |
IEnumerable <int> |
Metrics(1000, 12) |
Returns a collection of all distinct values for the specified metric for the specified period of time. Where a single measurement returns multiple values (distinct periods) for a single metric on a single SAP system, multiple values are returned. When used in a global context (within the TotalConsumption method), values for all distinct periods but summed up across all SAP systems are returned. |
|||||||||||||||||||||
Metrics(int metricID, int numMonths, string periodType) |
IEnumerable <int> |
Metrics(1000, 12, "C") |
Returns a collection of all distinct values for the specified metric for the specified period of time and where the period of the value has the specified type. Where a single measurement returns multiple values (distinct periods) for a single metric on a single SAP system, multiple values are returned. When used in a global context (within the TotalConsumption method), values for all distinct periods but summed up across all SAP systems are returned. Allowed period values:
|
|||||||||||||||||||||
Active(bool condition) |
string |
Active(Metric(1000) > 0) |
Returns "Active" if the specified condition is evaluated as true, otherwise returns "Inactive". |
|||||||||||||||||||||
If(bool condition, int trueResult, int falseResult) |
integer |
If(Metric(1000) > 0, Metric(1000), 0) |
If executes a different formula depending on whether the specified condition is true. |
|||||||||||||||||||||
If(bool condition, string trueResult, string falseResult) |
string |
If(Metric(1000) > 0, "Active", "Inactive") |
This example is equivalent to "Active(Metric(1000) > 0)" |
|||||||||||||||||||||
If(bool condition, object trueResult, object falseResult) |
object |
If(Metric(1000) > 0, Metric(1000), "Inactive") |
If executes a different formula depending on whether the specified condition is true. |
|||||||||||||||||||||
TotalConsumption(object totalConsumed) |
n/a |
TotalConsumption (Metric(1000)) TotalConsumption (Active(Metric(1000) > 0)) |
Runs the formula once for the entire organization, rather than once per system. |
|||||||||||||||||||||
TotalConsumption(object totalConsumed, object systemConsumed) |
n/a |
TotalConsumption (Metric(1000), Metric(1000)) |
Runs the first formula once for the entire organization, and the second formula once per system. |