← define_hierarchical_ruleset operator page · definitions/define_hierarchical_ruleset/condition/conditioning_variable
pandas ✅ · DuckDB ✅
a ruleset on Id_2 conditioned by the variable Id_1, when Id_1 = "X" then A = B.
define hierarchical ruleset: varConditioningSignature ::= condVariable { as vdAlias } ..., and the left condition "defines the pre-condition for evaluating the left member Code Item (i.e., it is evaluated only when the leftCondition is true)".
one data point, for X: 5 = 5, so bool_var is true and imbalance 0. Y fails the condition and is not compared, so the output all, "all the Data Points produced by the comparison", has no data point for it: the reading of the closed issue #1141.
define hierarchical ruleset HR_1 (variable condition Id_1 rule Id_2) is
when Id_1 = "X" then A = B
end hierarchical ruleset;
DS_r := check_hierarchy(DS_1, HR_1 condition Id_1 rule Id_2 all);
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| X | A | 5 |
| X | B | 5 |
| Y | A | 5 |
| Y | B | 4 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{
"name": "Id_1",
"type": "String",
"role": "Identifier",
"nullable": false
},
{
"name": "Id_2",
"type": "String",
"role": "Identifier",
"nullable": false
},
{
"name": "Me_1",
"type": "Number",
"role": "Measure",
"nullable": true
}
]
}
]
}
| Id_1 | Id_2 | ruleid | bool_var | imbalance | errorcode | errorlevel |
|---|---|---|---|---|---|---|
| X | A | 1 | true | 0 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{
"name": "Id_1",
"type": "String",
"role": "Identifier"
},
{
"name": "Id_2",
"type": "String",
"role": "Identifier"
},
{
"name": "ruleid",
"type": "String",
"role": "Identifier"
},
{
"name": "bool_var",
"type": "Boolean",
"role": "Measure"
},
{
"name": "imbalance",
"type": "Number",
"role": "Measure"
},
{
"name": "errorcode",
"type": "String",
"role": "Measure"
},
{
"name": "errorlevel",
"type": "Integer",
"role": "Measure"
}
]
}
]
}