Solved

Display Months Vs Days

  • 7 December 2021
  • 1 reply
  • 45 views

HI I am playing with looker in creating different views/looks,  I have a table that I currently working where when I try to show the Tenure of an employee looker is returning the data in Days  where as I would like to see the data displayed as Months/Year 

 

For example here’s what I have in a table

 

Name                  Tenure Today

John Doe            400

 

I would like to this to display as 

 

Name                 Tenure Today

John Doe           1.1 Year

 

icon

Best answer by leobardor 14 December 2021, 03:52

View original

This topic has been closed for comments

1 reply

Userlevel 2

Hi Momo,

 

It looks like you may need a new dimension in your LookML to do the trick.

Please find the following steps in this example to achieve the desired output.

1.- Create two dimensions as it is shown in the example, these 2 dimensions have the following purpose:

employee_tenure_in_years:  get the conversion of days to years. This is a number type dimension

 

employee_tenure_in_yeats_with_label:  add the label “year(s)” to the dimension1. This is a string type dimension

 

2.- Save all changes in your LookML and open an explore to see the output:

 (Please see the green rectangle in this screenshot ):

 

Hope it helps!

 

Best regards,

Leo