Tabs, New Lines, etc. in String Dimension

PaulM1
New Member

I have noticed that string formatting is stripped away in Looker. Example, if I have a string Dimension and the underlying data contains tabs or line feeds, this formatting is removed in the resulting Looker query.

Are there any ways to change that behavior?

Solved Solved
0 1 2,319
1 ACCEPTED SOLUTION

I think the effect you’re referring to is actually the result of the browser’s default behavior for text content. The data should still contain that whitespace if you download it as a csv, for example.

If you add an html declaration to your dimension, you can be more explicit about how it is displayed in the browser, including by using a `<pre>` tag or using a `style=”white-space:...”` attribute

So approximately this:
dimension: foo {
  ...
  html:<div style="white-space:pre">{{value}}</div>;;
}

View solution in original post

1 REPLY 1

I think the effect you’re referring to is actually the result of the browser’s default behavior for text content. The data should still contain that whitespace if you download it as a csv, for example.

If you add an html declaration to your dimension, you can be more explicit about how it is displayed in the browser, including by using a `<pre>` tag or using a `style=”white-space:...”` attribute

So approximately this:
dimension: foo {
  ...
  html:<div style="white-space:pre">{{value}}</div>;;
}

Top Labels in this Space
Top Solution Authors