Can you build utility functions in liquid?

CliffM
New Member

We have a requirement which will cause us to have to conditionally format the HTML dynamically for currency values, similar to this, 

https://community.looker.com/technical-tips-tricks-1021/conditional-dynamic-value-format-value-forma...

Unfortunately, there are close to 100 currency points within our model that would be affected so I’d like to be able to encapsulate this to a single convert_currency_string(value, currency_code) type function. Is there a way to support this broadly available utility function concept?

Thanks in advance

0 1 72
1 REPLY 1

Unfortunately not. Currency is one of those things that could really use with some advanced DRY patterns in LookML but we haven’t seen any improvement in that area. 

I proposed something that I think you’re referring to. Ability to create a constant that could be used in value_format_name

https://community.looker.com/lookml-5/dynamic-value-format-name-19992

This one is based on a parameter but it would be great to make it based on the data itself too

Top Labels in this Space
Top Solution Authors