New Table Visualization - Date/Time Measure Not Displaying (bug?)

PaulM1
New Member

I think the best way to explain this is through repro steps. Please bear with me. My backend is confined to Snowflake. So I’m not sure if the backend makes a difference.

1.) Create and populate a new table in your Looker connected database:

create table DBO.ZTEST (id int, cdate timestamp_ntz);
insert into DBO.ZTEST (id, cdate) values (1, '2020-01-01');
insert into DBO.ZTEST (id, cdate) values (1, '2020-01-03');
insert into DBO.ZTEST (id, cdate) values (1, '2020-01-05');
insert into DBO.ZTEST (id, cdate) values (1, '2020-01-07');

2.) Create a new Looker View from the new table (I let Looker auto-create mine)

3.) Add the following Measure to the View:

  measure: cdate_measure {
    type: date
    sql: MIN(${TABLE}."CDATE") ;;
    convert_tz: no
    label: "CDate Measure"
  }

4.) Add the View to your Model:

explore: ztest {}

(don’t forget to save the changes to the View & Model)

5.) Navigate the Explore menu, and select the ‘ZTest’ Explore you just created

6.) Add the following fields to the query: “ID” and “CDate Measure”

7.) Run the query

The results should appear as expected with “1/1/2020” in the CDate Measure column:

8.) Expand Visualization

9.) Select the button for the “Table” Visualization

Visualization results should mirror the Data results:

10.) Select the Gear to edit the Visualization

11.) In the Visualization Edit dialog, click the ‘Series’ tab

Notice the value for ‘CDate Measure’ in the Visualization becomes a thick black vertical bar:

This behavior is not present when using the Legacy Table visualization. If you change the Visualization to ‘Table (legacy)’, notice the value for ‘CDate Measure’ returns as expected.

I have tested this with different TYPES for the Measure (date, date_time, time, etc.). They all behave the same. It also doesn’t matter if ‘convert_tz’ is omitted. Finally, I also get this behavior from other Views that I have in production.

My entire ‘ZTEST’ View looks like this:

view: ztest {
  sql_table_name: "DBO"."ZTEST"
    ;;
  drill_fields: [id]

  dimension: id {
    primary_key: yes
    type: number
    sql: ${TABLE}."ID" ;;
  }

  dimension_group: cdate {
    type: time
    timeframes: [
      raw,
      time,
      date,
      week,
      month,
      quarter,
      year
    ]
    sql: ${TABLE}."CDATE" ;;
  }

  measure: cdate_measure {
    type: date
    sql: MIN(${TABLE}."CDATE") ;;
    convert_tz: no
    label: "CDate Measure"
  }

  measure: count {
    type: count
    drill_fields: [id]
  }
}
0 4 612
4 REPLIES 4
Top Labels in this Space