Date Label Issue

Hi Community,

I am new to looker.  I have mapped in a new model and in the view there are a number of Date fields.

All of them have added the  string “Date” to the end of the title.  I have tried to override with a label tag in the LookML but has made no difference.   Also seems to be no way to edit the title in the visualisation settings

Any ideas?

thanks

2f058345-8d0b-4631-896a-8c9a95dc6063.png
58dd503a-11c0-4cfc-ae71-b9f142630454.png
0 2 252
2 REPLIES 2

Resolved its taking the Date Hierarchy Label , also figured out howto overwrite label

Please share your solution, so others with similar issue can benefit as well.

My go to solution is to do something like this

Explore

c9fd37b3-511c-403c-8c0d-735056ca5e87.png


LookML code

  dimension_group: dim__updated {
group_label: "Date: Updated"
group_item_label: "{% assign tf = _field._name | split: '_' %}{{ tf | last | capitalize }}"
label: " Updated"
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.updated_at ;;
}

What happens in ‘group_item_label’ is as follows
1. Get the field name e.g. “dim__updated_date”, “dim__updated_month”…
2. Split the retrieved value by  ‘_’, creating list of parts, e.g. ['dim', ' ', 'updated', 'date'], ['dim', ' ', 'updated', 'month'], …
3. Get the last element of the list e.g. 'date', 'month', …
4. Capitalise it and that becomes your ‘group_item_label’ e.g. “Date”, “Month”, ... 

Top Labels in this Space
Top Solution Authors