Skip to main content

Dimensions (Looker to Holistics)

High-level Overview

Looker dimensions and Holistics dimensions serve similar purposes but have some key differences in syntax and capabilities:

  1. Syntax Differences

    • Looker uses ${TABLE} for table references, Holistics uses #SOURCE
    • Looker uses ${field_name} for field references, Holistics uses {{ field_name }}
    • Looker uses sql: for definitions, Holistics uses definition: @sql or definition: @aql
  2. Data Types

    • Looker: string, number, time, yesno
    • Holistics: text, number, datetime/date, truefalse
  3. Date Handling

    • Looker uses dimension_group to create multiple time-based dimensions at modeling time
    • Holistics provides flexible date handling at query time - users can change date grains and extract date parts directly in the UI without requiring predefined dimensions. Please visit Date Drill, Date Part, and Time Intelligence Functions for more details.

Step-by-Step Migration Tutorial

Step 1: Set Up Your Environment

  1. Open your Looker view file containing the dimensions
  2. Create a new Holistics model file
  3. Have the type mapping reference ready

Step 2: Migrate Basic Dimensions

  1. Start with simple column references:
// Looker
dimension: first_name {
label: "First Name"
type: string
sql: ${TABLE}.first_name ;;
}

// Holistics
dimension first_name {
label: 'First Name'
type: 'text'
definition: @sql {{ #SOURCE.first_name }};;
}

Step 3: Handle Computed Dimensions

  1. Convert SQL references:
// Looker
dimension: full_name {
type: string
sql: CONCAT(${first_name}, ' ', ${last_name}) ;;
}

// Holistics
dimension full_name {
type: 'text'
definition: @sql CONCAT({{ first_name }}, ' ', {{ last_name }});;
}

Step 4: Migrate Case Statements

  1. Convert Looker's case syntax to SQL CASE:
// Looker
dimension: size_tier {
case: {
when: {
sql: ${size} < 10 ;;
label: "Small"
}
when: {
sql: ${size} >= 10 AND ${size} < 50 ;;
label: "Medium"
}
else: "Large"
}
}

// Holistics
dimension size_tier {
type: 'text'
definition: @sql
CASE
WHEN {{ size }} < 10 THEN 'Small'
WHEN {{ size }} >= 10 AND {{ size }} < 50 THEN 'Medium'
ELSE 'Large'
END;;
}

Step 5: Handle Date Dimensions

  1. For date/time fields, you only need to define the base datetime dimension:
// Looker
dimension_group: created {
type: time
timeframes: [date, week, month, year]
sql: ${TABLE}.created_at ;;
}

// Holistics
dimension created_at {
type: 'datetime'
definition: @sql {{ #SOURCE.created_at }};;
}

In Holistics, users can change date grains (year, quarter, month, week, date) and extract date parts directly in the UI without requiring predefined dimensions like in Looker. Please refer to:

Step 6: Test and Validate

  1. Check all dimension types are correctly mapped
  2. Verify SQL references are properly converted
  3. Test each dimension in a simple report
  4. Compare results with original Looker dimensions

Reference Manual

Type Mapping

Looker TypeHolistics TypeNotes
stringtextDirect mapping
numbernumberDirect mapping
timedatetimeUse date for date-only values
yesnotruefalseDirect mapping
tiertextConvert to CASE statement
locationtextNo direct equivalent

Property Mapping

Looker PropertyHolistics PropertyNotes
labellabelDirect mapping
descriptiondescriptionDirect mapping
hiddenhiddenUse true/false instead of yes/no
sqldefinitionMust include @sql or @aql tag
typetypeSee Type Mapping

Unsupported Features

The following Looker features don't have direct equivalents in Holistics:

  • alpha_sort
  • order_by_field
  • suggest_dimension
  • suggest_explore
  • tags
  • drill_fields -> will be supported in the future (learn more)

Common Patterns

  1. SQL References

    • ${TABLE}{{ #SOURCE }}
    • ${dimension_name}{{ dimension_name }}
    • ${created_date}{{ created_date }}
  2. Boolean Logic

    // Looker
    type: yesno
    sql: ${value} > 100 ;;

    // Holistics
    type: 'truefalse'
    definition: @sql {{ value }} > 100;;
  3. String Concatenation

    // Looker
    sql: ${first_name} || ' ' || ${last_name} ;;

    // Holistics
    definition: @sql {{ first_name }} || ' ' || {{ last_name }};;
    // or
    definition: @aql concat(users.first_name, ' ', users.last_name);;

Best Practices

  1. Use AQL for Complex Transformations

    • AQL provides better readability and maintainability
    • Easier to handle complex business logic
    • Better error messages and type checking
  2. Consistent Naming

    • Keep dimension names consistent with Looker for easier maintenance
    • Use clear, descriptive names for new dimensions
  3. Documentation

    • Always include descriptions for dimensions
    • Document any deviations from Looker implementation
  4. Testing

    • Create test reports to validate migrated dimensions
    • Compare results with original Looker reports
    • Test edge cases and null handling

Detailed Feature Comparison

LookML ParameterPurposeSupportHolistics Equivalent & Implementation
Structural Parameters
dimensionCreates a dimension fieldHolistics dimension
dimension_groupCreates several time-based dimensions at the same timeHolistics has several equivalent options:
- Date Drill
- Date Part
- Time Intelligence Functions
Action and Linking Parameters
actionCreates clickable actions on dimension values✔️ (partial)Holistics Actions
Note: Holistics Actions can only be defined in Dashboard layer
drill_fieldsSpecifies fields to show when drilling into dimension🛠️ (will support soon)Holistics Drill Down
tagsAdds text that can be passed to other applicationsNo direct equivalent
linkCreates links to other Looker content or external URLsCan be solved with Holistics Actions
Display Parameters
aliasCreates alternate names for backward compatibilityNo direct equivalent
alpha_sortMakes case parameter sort conditions alphabeticallyNo direct equivalent
descriptionAdds explanatory text for the dimensionUses description parameter
group_labelGroups dimensions together under a headingNo direct equivalent
group_item_labelSpecifies label for field under its group labelNo direct equivalent
hiddenControls visibility in the UIUses hidden parameter with true/false
labelChanges how the dimension appears in the UIUses label parameter
order_by_fieldSorts dimension by values of another fieldNo direct equivalent
styleChanges how tiers appear in UINo direct equivalent
view_labelChanges how dimension's view appears in field pickerNo direct equivalent
Filter Parameters
can_filterLets you prohibit a dimension from being used as a filterNo direct equivalent
case_sensitiveControls case sensitivity in filtersNo direct equivalent
skip_drill_filterStops dimension from being added to filters when drillingNo direct equivalent
Filter Suggestion Parameters
bypass_suggest_restrictionsShows suggestions when sql_always_where is in useNo direct equivalent
full_suggestionsControls how database is queried for suggestionsNo direct equivalent
suggest_dimensionBases suggestions on values of different dimensionNo direct equivalent
suggest_exploreBases suggestions on values of different exploreNo direct equivalent
suggest_persist_forChanges cache settings for suggestionsNo direct equivalent
suggestableEnables or disables suggestions for a fieldNo direct equivalent
suggestionsControls filter suggestionsNo direct equivalent
Query Parameters
convert_tzControls timezone conversionNo direct equivalent
primary_keyIndicates if the dimension is a primary keyNo direct equivalent
required_access_grantsControls access based on user attributesNo direct equivalent in basic AMQL, but Holistics handles access control differently
required_fieldsRequires additional fields when this field is chosenNo direct equivalent
Value and Formatting Parameters
htmlModifies HTML output using Liquid templatingNo direct equivalent
sqlDefines the SQL expression for the dimensionUses definition with either @sql or @aql tag
sql_latitudeDefines latitude for location type dimensionsNo direct equivalent
sql_longitudeDefines longitude for location type dimensionsNo direct equivalent
typeSpecifies the data type of the dimensionUses type with values: 'text', 'number', 'date', 'datetime', 'truefalse'
Visualization Parameters
map_layer_nameSpecifies custom map for geographic dataNo direct equivalent

(*) Looker Parameters that are not mentioned in this table are generally not supported


Let us know what you think about this document :)