Unlock the power of your data in the cloud! Get hands-on with Google Cloud's core data services like BigQuery and Looker to validate your practical skills in data ingestion, analysis, and management, and earn your Associate Data Practitioner certification!
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
An e-commerce company uses Looker to analyze transaction data. A data analyst needs to update the orders.view file to add a new field that calculates the total monetary revenue by summing the values of an existing sale_price dimension.
Which LookML code block correctly defines this aggregate field?
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
measure parameter isIn LookML, a measure defines an aggregate computation or measurable metric across multiple rows of data, such as sums, averages, counts, or distinct counts. While dimensions represent row-level attributes, measures perform SQL aggregations that summarize data when queried.
measure: total_sales tells Looker that this field represents an aggregated calculation rather than a non-aggregate row-level attribute.type: sum instructs Looker to generate a SQL SUM() aggregation in the underlying database query.sql: ${sale_price} ;; syntax uses Looker's substitution operator (${field_name}) to reference the pre-existing sale_price dimension, adhering to sustainable modeling practices and code reusability.GROUP BY and SUM() syntax based on any dimensions selected alongside this measure in an Explore.${sale_price} dimension ensures that if the underlying database column mapping ever changes, only the base dimension definition requires updating.Total Sales appears under the measures section in the field picker, enabling non-technical users to build reports without writing SQL.Declaring an aggregate metric as a measure of type: sum referencing ${sale_price} is the standard, valid LookML pattern for computing numeric totals from dimensions.