How To: Date Format Localization in Looker

Context

  • There is no out of the box setting for date format localization as of 10/26/23
  • You can format dates using liquid, following these instructions

Instructions

First create a User Attribute to drive the date formats. In our example, we will have some US based users and some EU based users.

emilydetmer_0-1699318445246.png

Create a new dimension for your formatted date. Then use the html parameter to format your date in a liquid if statement that references your user attribute.

emilydetmer_1-1699318445302.png

This is how both of these dimensions will appear to an end user with the eu value in their date_location user attribute.

emilydetmer_2-1699318445228.png

 

emilydetmer_3-1699318445256.png

 

Next we need to think about how this dimension will appear to our user in the explore. Instead of two separate dimensions, we want our new date dimension to replace the existing Date timeframe in the Created Date dimension group. This will also allow us to use one dimension in the same report that will have different formatting depending on the user.

Remove the Date timeframe from the Created Date dimension group emilydetmer_4-1699318445258.png

Add type, group_label, and label parameters to the new formatted dimension emilydetmer_5-1699318445265.png

Now this is how the dimension group appears to an eu user:

emilydetmer_6-1699318445260.png

 

0 3 1,605
3 REPLIES 3
Top Labels in this Space