LookML concatenation with space in between fields

Trying to concatenate dimensions and separate them with a space or dash but when I add in the character the new concatenated string does not populate. Simple example - 

Dims - cat, dog

function that does work: concat(cat, dog) = tabbypitbull

desired result: concat(cat,” “, dog) = tabby pitbull


-it was posted earlier in the community, but not resolved. Can anyone please help?

0 4 2,526
4 REPLIES 4

Dawid
Participant V

concat(field, “ “, field) works fine for me so it may be something else that’s making this not work in your case

debe66ca-af36-418c-b6d6-7c920675b624.png

5fbb7c03-860a-4ffc-bd16-591ec39102c0.png

Hi,
Thanks for the prompt revert, but i am still facing this error while definning a dim - impression_code

ah, i see. you did it at custom field option in explore, while I am trying to define at view level

Dawid
Participant V

Ah  I though you were doing this in Table Calculations. 

Then I would make sure you get the desired result in your database first, whatever your dialect is. 

A couple years late, but for future searchers, I found that CONCAT() wouldn't accept a string as an argument in LookML Dimension SQL

CONCAT(cat,dog) worked

CONCAT(cat,' ',dog) failed

CONCAT(cat," ",dog) failed

I tested an alternate method of concatenation using + and found that cat+dog worked, and then confirmed that cat + ' ' + dog worked

Top Labels in this Space
Top Solution Authors