← define_hierarchical_ruleset operator page · definitions/define_hierarchical_ruleset/variable/unbalanced_total
pandas ✅ · DuckDB ✅
a ruleset on the variable Id_2, which check_hierarchy names again with rule Id_2.
define hierarchical ruleset: varRulesetSignature ::= variable { condition varConditioningSignature } rule ruleVariable, and in check_hierarchy the components "can be specified all the same if it is desired to show explicitly in the invocation which are the involved Components".
with the defaults non_null and dataset and the output all, A = B + C fails, 10 against 4 + 5 = 9: bool_var false, imbalance 1 and ruleid 1. errorcode and errorlevel are null, imbalance is a Number like Me_1, ruleid and errorcode Strings, and errorlevel Integer, the manual's default without errorlevel_vd (#1256).
define hierarchical ruleset HR_1 (variable rule Id_2) is
A = B + C
end hierarchical ruleset;
DS_r := check_hierarchy(DS_1, HR_1 rule Id_2 all);
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 1 | A | 10 |
| 1 | B | 4 |
| 1 | C | 5 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{
"name": "Id_1",
"type": "Integer",
"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 |
|---|---|---|---|---|---|---|
| 1 | A | 1 | false | 1 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{
"name": "Id_1",
"type": "Integer",
"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"
}
]
}
]
}