Dimension/Measure/Parameter Naming Conventions

PaulM1
New Member

Can anyone share some pros & cons for using CamelCase vs lower_case for naming Dimensions, Measures, and Parameters? For example:

  dimension: CreatedDate {
    label: "Created Date"
    type: number
    sql: ${TABLE}.CreatedDate ;;
  }

Or:

  dimension: created_date {
    label: "Created Date"
    type: number
    sql: ${TABLE}.CreatedDate ;;
  }

I feel like I would like to standardize our LookML using CamelCase. But I would definitely like to hear from any veterans out there. TIA!

0 2 570
2 REPLIES 2

To me itโ€™s always easier to read words where thereโ€™s some kind of a gap between them.

Looker UI will replace the underscore with space and capitalise the words if you donโ€™t use label but if you use labels anyway, itโ€™s much more about your preference.

I have been writing code for more than a decade and prefer lowercase everywhere apart from SQL and since LookML feels to be more like a back-end language thatโ€™s what I apply

I agree with @Dawid that itโ€™s pretty much about your preference ๐Ÿ‘

To me, if your database columns are named like how you have it in your example, CreatedDate, then I think Iโ€™d prefer the dimensions, measures, parameters, etc. to be named the same way, rather than created_date.

Top Labels in this Space
Top Solution Authors