Exercise 5: Create a Row Count Comparison Test
  • 09 Jul 2024
  • 1 Minute to read
  • PDF

Exercise 5: Create a Row Count Comparison Test

  • PDF

Article summary

Learning Goals
  • How do I create a new test?
  • How do I get the row count from a table?
  • How do I compare that to another table?
  • How do I allow for minor differences or timing issues?

Step 1 - Create a Standard Test

  • Click New to create a New Standard Test
  • Name the Test "Row Count - Raw vs Staging"
  • Set the Quality Dimension to "Consistency"
  • Set the Severity Level to "Medium"
  • Give the test a nice description like "This test compares the row count between the RAW and STAGE_10 tables for {{table_name}}"

image.png

Step 2 - Configure "What do you want to test?"

  • Set Data Source = Sample Data Source - Snowflake Data Warehouse
  • Set How to get the data = Row Count
  • Set the table to your assigned RAW table.
  • Click the Preview and Refresh Options button

image.png

Step 3 - Configure "What do you want to compare to?"

  • Select "Another Data Set"
  • Set Data Source = Sample Data Source - Snowflake Data Warehouse
  • Set How to get the data = Row Count
  • Set the table to your assigned STAGING table.
  • Click the Preview and Refresh Options button

image.png

Step 4 - Review Result Configuration

  • Scroll down to the Result Configuration section
  • Click to set the Treat values as Numeric
  • Change the Value Success Criteria to allow for an Absolute Numeric Difference of 10

image.png

  • Save the test
  • Run the test to the screen to view results

Tips About Validatar

  • There are two types of tests: Standard and Template.
  • Be sure not to confuse the Test Data Set and Control Data Set configuration boxes.
  • Choosing a Data Source and How to Get the Data is required to create a test.
  • The Preview & Refresh Options button will show you what the result structure will look like.

Was this article helpful?