diff --git a/README.md b/README.md index 114c12c4..c012c4b3 100644 --- a/README.md +++ b/README.md @@ -965,9 +965,16 @@ This macro calculates the difference between two dates. #### split_part ([source](macros/cross_db_utils/split_part.sql)) This macro splits a string of text using the supplied delimiter and returns the supplied part number (1-indexed). +**Args**: +- `string_text` (required): Text to be split into parts. +- `delimiter_text` (required): Text representing the delimiter to split by. +- `part_number` (required): Requested part of the split (1-based). If the value is negative, the parts are counted backward from the end of the string. + **Usage:** +When referencing a column, use one pair of quotes. When referencing a string, use single quotes enclosed in double quotes. ``` -{{ dbt_utils.split_part(string_text='1,2,3', delimiter_text=',', part_number=1) }} +{{ dbt_utils.split_part(string_text='column_to_split', delimiter_text='delimiter_column', part_number=1) }} +{{ dbt_utils.split_part(string_text="'1|2|3'", delimiter_text="'|'", part_number=1) }} ``` #### date_trunc ([source](macros/cross_db_utils/date_trunc.sql))