Expect a sum of columns to be equal to other column (in a row perspective).
expect_multicolumn_sum_values_to_be_equal_to_single_column
This expectation level is BETA
Contributors:
Tags:
multi-column expectation
multi-column sum values to be equal to single column
Metrics:
multicolumn_values.sum_values_equal_to_single_column.unexpected_count
table.row_count
multicolumn_values.sum_values_equal_to_single_column.filtered_row_count
multicolumn_values.sum_values_equal_to_single_column.unexpected_values
Description
Expect a sum of columns to be equal to other column (in a row perspective).
This means that for each row, we expect col_a + col_b + ... + col_n-1 == col_n
Args:
- column_list (list of str): A list of 2 or more integer columns, in which we expect the sum of the first n-1th columns to be equal to the nth column. This means that if one wants to compare between the sum of n-1 columns and the nth column, it needs to put the nth column at the end of the list.
Want to make your own Expectation or an improvement to this one?
We've put together some great how to guides (including videos) on how to create your own expectations in a flash!
You can see those resources here: Contributor Resources