Last active
August 29, 2015 14:15
-
-
Save LinuxBozo/81afc62ac939022d098e to your computer and use it in GitHub Desktop.
Examples for compareNum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "Q031", | |
"description": "If property type = 3, then the total number of multifamily applications should be < 200.", | |
"explanation": "Number of reported multifamily applications is ≥ 200; Verify.", | |
"rule": { | |
"property": "hmdaFile", | |
"condition": "call", | |
"function": "compareNumEntriesSingle", | |
"args": [ | |
"hmdaFile.loanApplicationRegisters", | |
{ | |
"label": "Total multifamily applications", | |
"property": "propertyType", | |
"condition": "equal", | |
"value": "3" | |
}, | |
{ | |
"property": "result", | |
"condition": "less_than", | |
"value": "200" | |
} | |
] | |
} | |
}, | |
{ | |
"id": "Q007", | |
"description": "If action taken type = 2, then the total number of these loans should be ≤ 15% of the total number of loan applications.", | |
"explanation": "Total number of loan applications with an action code of 2 is > 15% of the total number of loan applications.", | |
"rule": { | |
"property": "hmdaFile", | |
"condition": "call", | |
"function": "compareNumEntries", | |
"args": [ | |
"hmdaFile.loanApplicationRegisters", | |
{ | |
"label": "Loans where action taken = 2", | |
"property": "actionTaken", | |
"condition": "equal", | |
"value": "2" | |
}, | |
{ | |
"label": "Total loan applications", | |
"property": "recordID", | |
"condition": "equal", | |
"value": "2" | |
}, | |
{ | |
"label": "% of Total loan applications", | |
"property": "result", | |
"condition": "less_than_or_equal", | |
"value": ".15" | |
} | |
] | |
} | |
}, | |
// more complicated example | |
"id": "Q047", | |
"description": "If preapproval = 1, and action taken type = 4, then the total number of these loans should be ≤ 10% of the total number of loan applications.", | |
"explanation": "Total number of loan applications with a preapproval = 1 and action taken type = 4 is > 10% of the total number of loan applications.", | |
"rule": { | |
"property": "hmdaFile", | |
"condition": "call", | |
"function": "compareNumEntries", | |
"args": [ | |
"hmdaFile.loanApplicationRegisters", | |
{ | |
"label": "Loans where preapproval = 1 and action taken = 4", | |
"and": [ | |
{ | |
"property": "preapprovals", | |
"condition": "equal", | |
"value": "1" | |
}, | |
{ | |
"property": "actionTaken", | |
"condition": "equal", | |
"value": "4" | |
} | |
] | |
}, | |
{ | |
"label": "Total loan applications", | |
"property": "recordID", | |
"condition": "equal", | |
"value": "2" | |
}, | |
{ | |
"label": "% of Total loan applications", | |
"property": "result", | |
"condition": "less_than_or_equal", | |
"value": ".1" | |
} | |
] | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment