# sql case functions and colons put in line breaks

**URL:** <https://discourse.getdbt.com/t/sql-case-functions-and-colons-put-in-line-breaks/12668>\
**Category:** Help\
**Tags:** jinja, snowflake, dbt-cloud, dbt-core\
**Created:** [March 29, 2024, 11:08pm UTC](https://discourse.getdbt.com/t/sql-case-functions-and-colons-put-in-line-breaks/12668 "2024-03-29T23:08:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Norton](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Simon\_Norton](https://discourse.getdbt.com/u/Simon_Norton)\
**Post date:** [March 29, 2024, 11:08pm UTC](https://discourse.getdbt.com/t/sql-case-functions-and-colons-put-in-line-breaks/12668/1 "2024-03-29T23:08:52Z")

</div>

Hi All:

When I use upper(), lower() or initcap() functions, the output SQL always has line breaks if I have a jinja expression as the input. For instance, `lower({{ columnName }})` compiles as:

```auto
            lower(
            'ABC123'
        )

```

literally typing in `lower('ABC123')` formats without any line breaks.

Is this a setting I can modify? It only does it for the 3 string casing functions. To this point I have not seen this happen with any other SQL functions.

I am, however, seeing the same behavior if there is a full colon in the output.  
`{{ ColumnName }} : {{ SomeOtherVar }}` formats as:

```auto
            ActualColumnName :
                        AcutalOtherVarValue

```

My goal is to format the outputs as an entry to a Python dictionary. So I really need the output to be:  
`ColumnName : lower(ColumnName)`

As an FYI, this is the format required by the dbt package dbtvault (A.K.A AutomateDV) for a derived column.

Many thanks for any assistance!  
Simon

---

<div class="post-metadata">

**Author:** ![Simon\_Norton](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Simon\_Norton](https://discourse.getdbt.com/u/Simon_Norton)\
**Post date:** [April 17, 2024, 5:10pm UTC](https://discourse.getdbt.com/t/sql-case-functions-and-colons-put-in-line-breaks/12668/2 "2024-04-17T17:10:27Z")

</div>

It’s stubborn, but the replace filter can remove all the line feeds:

```jinja2
{%- set lowerstring -%}
    lower({{ space_cleanup(input_column, spacing) }})
{%- endset -%}

{{ lowerstring | replace('\n','') }}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [April 24, 2024, 5:11pm UTC](https://discourse.getdbt.com/t/sql-case-functions-and-colons-put-in-line-breaks/12668/3 "2024-04-24T17:11:06Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
