Get Started Transforming Your Data in Snowflake

How to comment on an entire block of code in the LookML editor of Looker.

  • January 22, 2018

In Looker, one can follow the below instructions to comment a block of code in LookML editor

  1. Select the lines which are required to be commented out.
  2. Press ⌘ + / on a Mac, or ctrl + / on a Windows computer.

The code should now be commented out with a # symbol like this:

#    dimension: example { 
#    type: string
#    sql: ${TABLE}.example ;;
#    }

Commenting out a piece of code in a SQL Block:  

If one comment on outlines that are entirely within a SQL code block, one would have to add general SQL comment notations manually.

1: Multi-line comments using /* and /*:

- view: example_facts
  derived_table:
    sql: 
      /*
       SELECT
       id, COUNT(*)
       FROM example_table
       GROUP BY id
       /*

2: Single line comments using (–):

- view: example_facts
  derived_table:
   sql: 
      SELECT
         id, COUNT(*)
         -- , MAX(date) as most_recent_date
       FROM example_table
       GROUP BY id

Up Next:

Read How to capture the count of records for a date between two dates in Looker?

More Resources We Think You Might Like

How to create a funnel chart visualization in Looker?

How to capture the count of records for a date ...

Assuming that the Date Dimension is already created, this can be achieved by creating count measu...

  • January 22, 2018
How to create a funnel chart visualization in Looker?

How to add image from my local drive (or locati...

We can use the HTML parameter in the LookML of the Dimension / Measure to have Looker render the ...

  • Looker FAQs
  • January 21, 2018
How to create a funnel chart visualization in Looker?

How to create a rolling average with table calc...

Let’s understand this in two parts. Part 1: What is a Moving Average?  If we want to calcul...

  • Looker FAQs
  • January 21, 2018