Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
emilieschario committed Jul 23, 2019
1 parent 565e1a3 commit 84a3e8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@ models:
### SQL helpers
#### get_column_values ([source](macros/sql/get_column_values.sql))
This macro returns the unique values for a column in a given table.
It takes an options `default` argument for compiling when relation does not already exist.

Usage:
```
-- Returns a list of the top 50 states in the `users` table
{% set states = dbt_utils.get_column_values(table=ref('users'), column='state', max_records=50) %}
{% set states = dbt_utils.get_column_values(table=ref('users'), column='state', max_records=50, default=[]) %}
{% for state in states %}
...
Expand Down

0 comments on commit 84a3e8e

Please sign in to comment.