Skip to main content

Views (Looker to Holistics)

High-level Overview

Looker View vs Holistics Model

In principle, a view in Looker corresponds to a model in Holistics.

Looker View to Holistics Model

A view in Looker represents a database table or a derived table. In Holistics, this is equivalent to a Table Model or Query Model. Holistics Model has the equivalent common concepts like table name, dimension, and measure.

Step-by-Step Migration Tutorial

Step 1: Identify View Type

  1. Determine if the view is based on a table or a derived query:
    • Table-based view → Table Model
    • Derived view → Query Model

Step 2: Create Model Structure

For table-based views:

// Looker
view: orders {
sql_table_name: public.orders ;;

# fields defined here...
}

// Holistics
Model orders {
type: 'table'
data_source_name: 'warehouse'
table_name: 'public.orders'

// fields defined here...
}

For derived views:

// Looker
view: active_users {
derived_table: {
sql: SELECT
user_id,
COUNT(DISTINCT order_id) as order_count
FROM orders
WHERE status = 'completed'
GROUP BY 1 ;;
}
}

// Holistics
Model active_users {
type: 'query'
data_source_name: 'warehouse'
query: @sql
SELECT
user_id,
COUNT(DISTINCT order_id) as order_count
FROM orders
WHERE status = 'completed'
GROUP BY 1;;
}

Step 3: Migrate Fields

After setting up the model structure, migrate the fields following these dedicated guides:

These guides provide detailed instructions for converting different types of fields and their properties.

Step 4: Handle Persistence (for derived views)

In Looker, persistence is configured within the derived table:

// Looker
view: order_summary {
derived_table: {
sql: SELECT
user_id,
COUNT(*) as order_count,
SUM(amount) as total_amount
FROM orders
GROUP BY user_id ;;
interval_trigger: "24 hours"
}
}

In Holistics, we handle this with Query Model persistence and schedules:

  1. Define persistence in the Query Model:
// in models/order_summary.model.aml
Model order_summary {
type: 'query'
query: @sql
SELECT
user_id,
COUNT(*) as order_count,
SUM(amount) as total_amount
FROM orders
GROUP BY user_id;;

persistence: FullPersistence {
schema: 'persisted'
view_name: 'order_summary'
}
}
  1. Set up refresh schedule:
// in schedules.aml
const schedules = [
// Refresh order_summary daily at midnight
Schedule {
models: [order_summary],
cron: '0 0 * * *' // daily at midnight
}
]

For more details on persistence options in Holistics, see our Persistence documentation.

Step 5: Test and Validate

  1. Verify all fields are correctly migrated
  2. Check data types are properly mapped
  3. Test derived calculations
  4. Compare query results with Looker

Step 6: Continue migrating models and explores

For more details on migrating models and explores, see the following guides:

Reference Manual

Model Types

Looker View TypeHolistics Model TypeWhen to Use
Regular ViewTable ModelFor direct table access
Derived ViewQuery ModelFor custom SQL queries
Extended ViewExtended ModelFor reusing existing models

Common Patterns

  1. Extension

    // Looker
    view: extended_orders {
    extends: [orders]

    dimension: is_high_value {
    type: yesno
    sql: ${amount} > 1000 ;;
    }
    }

    // Holistics
    Model extended_orders = orders.extend({
    label: 'Extended Orders',
    dimension is_high_value {
    type: 'truefalse'
    definition: @sql {{ amount }} > 1000;;
    }
    })

    More details about extension can be found in AML Extension

Detailed Feature Comparison


LookML ParameterPurposeSupportHolistics Equivalent & Implementation
Structural Parameters
drill_fieldsControl which fields to show when drilling/clicking a fieldHolistics currently supports drilling between dashboards as in Drill Through, but we haven't supported field-level control yet
extend (for view)Build a new View based on an existing ViewHolistics AML Extend
extensionForce using extends on a view🧪 (partial)Holistics doesn't support this exact concept but we can rebuild this via Function
includeAdd files to a view
testCreates a data test to verify your model's logic.Holistics doesn't support this feature yet.
setDefines a set of dimensions and measures to be used in other parametersHolistics doesn't support this feature yet.
viewCreate a viewHolistics data model
Display Parameters
labelThe label of the viewHolistics model's label label: 'Your Model Label'
fields_hidden_by_defaultWhen set to yes, hides all fields in the view by default.🧪 (partial)Holistics doesn't support this exact concept but we can extend a Model to hide fields
Field Parameters
suggestions (for view)Enables or disables suggestions for all dimensions on this view
Query Parameters
required_access_grants (for view)Limits access to the view to only users whose user attribute values match the access grants
sql_table_name (for view)Changes the SQL table on which a view is based- data_source_name: for specifying the data source name
- table_name: for specifying the table name in TableModel
- For dynamic schema, see our doc here
Derived Table Parameters
derived_tableA table based on a queryQuery Model
sql (for derived_table)Declares the SQL query for a derived tableUsing query: @sql your_query_here ;; parameter in Query Model
explore_sourceDefines a native derived table based on an ExploreHolistics doesn't support this feature yet.
sql_createDefines a SQL CREATE statement to create a PDT on a database dialect that requires custom DDL commandsCustom Persistence DDL
datagroup_triggerSpecifies the datagroup to use for the PDT rebuilding policy✔️
(partial)
Holistics doesn't have the exact concept of datagroup, but we can set schedule trigger on individual query model
interval_triggerSpecifies the interval to use for the PDT rebuilding policyUsing Holistics schedule trigger defined in schedules.aml file
sql_trigger_valueSpecifies the condition that causes a PDT to be regeneratedNot supported yet in Holistics.
persist_for (for derived_table)Sets the maximum age of a PDT before it is regenerated✔️
(partial)
Users cannot control this in Holistics yet, and the default value is 24 hours
increment_keyThe increment_key specifies the time increment for which fresh data should be queried and appended to the PDT.Using increment_column: 'your_column' parameter in persistence: IncrementalPersistence { }
Field Reference Parameters
dimensionlist of dimensionsDimension migration guide
measurelist of measuresMeasure migration guide
dimension_groupCreates several time-based dimensions at the same timeHolistics has several equivalent options:
- Date Drill
- Date Part
- Time Intelligence Functions
setsDefine a set of dimensions and measures to be used in other parametersHolistics doesn't have the exact set concept, but we a wide range of reusability features such as:
- Constant
- Function
- Extend
- String Interpolation
parameter, filter for Templated filtersCreates a filter-only field that can be used to filter Explores, Looks, and dashboards but that cannot be added to a result set.Query Parameter

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


Let us know what you think about this document :)