← check_datapoint operator page · validation/check_datapoint/all/manual_ex_2
pandas ✅ · DuckDB ✅
check_datapoint ( DS_1, dpr1 all ), in the manual's script, which calls dpr1 before its definition.
Check datapoint, Example 2, output verbatim: all "contains a data point for each Data Point of op and each Rule in dpr. The resulting Data Set has the boolean Measure bool_var"; the User Manual: "The order in which the user defines the Transformations ... cannot override the order of execution".
8 data points, one per data point and rule: rule 1 true on all four, the DEBIT ones by its false antecedent, and rule 2 false only on (2011, l, DEBIT), -2, with errorcode Bad debit, null on the valid results. ruleid is 1 or 2, "the progressive order number of the Rule in the Ruleset" (define datapoint ruleset), as the rules have no names, and the null errorlevel Integer, as the manual types it.
DS_r := check_datapoint ( DS_1, dpr1 all );define datapoint ruleset dpr1 ( variable Id_3, Me_1 ) is
when Id_3 = "CREDIT" then Me_1 >= 0 errorcode "Bad credit"
; when Id_3 = "DEBIT" then Me_1 >= 0 errorcode "Bad debit"
end datapoint ruleset;
| Id_1 | Id_2 | Id_3 | Me_1 |
|---|---|---|---|
| 2011 | l | CREDIT | 10 |
| 2011 | l | DEBIT | -2 |
| 2012 | l | CREDIT | 10 |
| 2012 | l | DEBIT | 2 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | bool_var | ruleid | errorcode | errorlevel |
|---|---|---|---|---|---|---|
| 2011 | l | CREDIT | true | 1 | ||
| 2011 | l | DEBIT | true | 1 | ||
| 2012 | l | CREDIT | true | 1 | ||
| 2012 | l | DEBIT | true | 1 | ||
| 2011 | l | CREDIT | true | 2 | ||
| 2011 | l | DEBIT | false | 2 | Bad debit | |
| 2012 | l | CREDIT | true | 2 | ||
| 2012 | l | DEBIT | true | 2 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Id_3", "type": "String", "role": "Identifier"},
{"name": "ruleid", "type": "String", "role": "Identifier"},
{"name": "bool_var", "type": "Boolean", "role": "Measure"},
{"name": "errorcode", "type": "String", "role": "Measure"},
{"name": "errorlevel", "type": "Integer", "role": "Measure"}
]
}
]
}