With the release of SAS Viya 3.5, you are now able to use Data Quality functions in SAS Intelligent Decisioning rules. The Data Quality functions enable the use of definitions from the SAS Quality Knowledge Base (QKB) in your SAS Intelligent Decisioning rules.
Previously, I demonstrated how you can perform a data completeness check using the Filtering rule type in SAS Intelligent Decisioning. In this article, I will also use the Filtering rule type; however, as part of the rule check I will use Data Quality functions.
The scenario that I will demonstrate in this article is finding records in a data set where the State field does not match the 'AA' pattern after standardization using the State/Province (Abbreviation) definition in the English-United States locale. If the following is my data set, then records with the ID of 4 and 7 should be returned by my filtering rule check.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Note: The State values highlighted in green will adhere to the 'AA' pattern after standardization using the State/Province (Abbreviation) definition in the English-United States locale.
I create a Filtering rule set for my scenario.
Next, I add the variables needed for my rule check – State and ID.
Then, I need to create the rule check itself. To do this I will select to open the Expression Editor to write a custom rule using Data Quality Functions. Below is the listing of Data Quality functions available to use in the Expression Editor of an Intelligent Decisioning rule. For more information on the Data Quality functions, please refer to its documentation.
I write the following expression to perform the rule check I described in my scenario. I select Validate to confirm it is valid syntax.
Below is the saved rule.
Now that the rule has been created, I need to test it. On the Scoring tab, I create a new test using my input data from earlier as its test data. Note: The variables are automatically mapped to the input data since the column names in the input table are the same names and types I created as variables for my rule.
I save and run the test.
I select to review the results of the test. As expected, IDs 4 and 7 are returned by the rule.
This rule can now be published and executed. For more information, refer to the SAS Intelligent Decisioning documentation.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.