From fe0e8eb169acf2f4e8f6877486fb701b29f98c7f Mon Sep 17 00:00:00 2001 From: Bryce Baker <36087020+bakerbryce@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:27:00 -0600 Subject: [PATCH] Update README.md (#872) * Update README.md Update doc for get_column_values() to specify that the order_by argument must be expressed as an aggregate function. * Add missing blank space --------- Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fa086ad3..d939fc8b 100644 --- a/README.md +++ b/README.md @@ -651,7 +651,7 @@ This macro returns the unique values for a column in a given [relation](https:// - `table` (required): a [Relation](https://docs.getdbt.com/reference/dbt-classes#relation) (a `ref` or `source`) that contains the list of columns you wish to select from - `column` (required): The name of the column you wish to find the column values of - `where` (optional, default=`none`): A where clause to filter the column values by. -- `order_by` (optional, default=`'count(*) desc'`): How the results should be ordered. The default is to order by `count(*) desc`, i.e. decreasing frequency. Setting this as `'my_column'` will sort alphabetically, while `'min(created_at)'` will sort by when thevalue was first observed. +- `order_by` (optional, default=`'count(*) desc'`): How the results should be ordered. Must be an aggregate function, i.e. count(*), max(sort_order). The default is to order by `count(*) desc`, i.e. decreasing frequency. Setting this as `'my_column'` will sort alphabetically, while `'min(created_at)'` will sort by when the value was first observed. - `max_records` (optional, default=`none`): The maximum number of column values you want to return - `default` (optional, default=`[]`): The results this macro should return if the relation has not yet been created (and therefore has no column values).