-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
percent not null #4
Comments
I was looking for a macro where a percent was not null, and found this issue. I understand that you may want to make it a more general test, but here is the macro I wrote for The test is as follows:
Minimum defaults to 0 if omitted, maximum defaults to 100 if omitted. Here is the code:
I had to choose what to return when an error condition was met. I decided to return the percentage. The other option was determining the number of rows that were NULL. There are pros and cons to each. If you have any feedback on how it can improve and be included in a future version of DBT, please let me know and I can submit as a pull request. |
I think this functionality is now covered by "not null proportion" - https://github.com/dbt-labs/dbt-utils/tree/0.8.4/#not_null_proportion-source |
or more generally, % of records where X in some range
The text was updated successfully, but these errors were encountered: