dating_platform/proposal_templates.view.lookml 25 dims1 measure 3 warnings Repo files

LookML view · dating-platform

The proposition_templates view: date idea templates with a fallback name rule

At a glance

Does
Reads proposition templates: category, location, featured and official flags, created, expires and deleted dates, and a display name. One measure: count.Trust: Source-defined
Why
A catalogue of date ideas that users can propose. The enterprise model explores it as date_ideas, joined to the propositions made from each template.Trust: Inferred
Grain
One row per template. id is the primary key.Trust: Source-defined
Source
dating_platform/proposal_templates.view.lookml 120 lines
Source: proposal_templates.view.lookml L1-10
dating_platform/proposal_templates.view.lookmlL1-10
- view: proposition_templates  sql_table_name: ${TABLE}.proposition_templates  fields:  - dimension: id    primary_key: true    type: int    sql: ${TABLE}.id  - dimension: category    sql: ${TABLE}.category  - dimension_group: created    type: time    timeframes:    - time

dating-platform, proposal_templates.view.lookml, lines 1-10

Shape

Trust: Source-defined

Every field as declared, with the dashboard tiles that read it. Computed from the source; nothing here is edited.

Table: ${TABLE}.proposition_templates

Dimensions 25

NameTypeSQLUsed byTags
idL4int${TABLE}.id-primary key
categoryL8string${TABLE}.category-
createdtime, date, week, monthL10time group${TABLE}.created_at-
datedate, week, monthL18time group${TABLE}.date-hidden
deleteddate, week, monthL26time group${TABLE}.deleted_at-
expiresdate, week, monthL33time group${TABLE}.expires_on-
globalL51yesno${TABLE}.global-
latL54number${TABLE}.lat-hidden
lngL58number${TABLE}.lng-hidden
locationL62string${TABLE}.location-
market_idL64int${TABLE}.market_id-hidden
meta_descriptionL68string${TABLE}.meta_description-hidden
meta_keywordsL71string${TABLE}.meta_keywords-hidden
meta_titleL74string${TABLE}.meta_title-hidden
nameL77string
COALESCE(${TABLE}.name, INITCAP(REPLACE(${TABLE}.slug...COALESCE(${TABLE}.name, INITCAP(REPLACE(${TABLE}.slug, '-', ' ')))
-derived
officialL80yesno${TABLE}.official-
proposition_idL83int${TABLE}.proposition_id-hidden
slugL87string${TABLE}.slug-hidden
timeL90string${TABLE}.time-
updatedtime, date, week, monthL92time group${TABLE}.updated_at-hidden
urlL101string${TABLE}.url-
user_idL103int${TABLE}.user_id-hidden
venue_idL107int${TABLE}.venue_id-hidden

Measures 1

NameTypeSQLUsed byTags
countL111countCOUNT(*) of rows-

Relationships

Trust: Source-defined

No joins, no upstream views and no dashboard tiles reference this view. It is an island in the model.

Relationships of proposition_templates
Relationships of proposition_templates. Text version follows the diagram.This viewUsed by: explores, views, dashboardsbase view date_ideas explore in enterprise
  • This Block
Text version
  • proposition_templates is the base view of date_ideas: base view

Worth noticing

Names fall back to the slug

Trust: Source-defined

name uses name when present, otherwise it turns slug into title case, so wine-tasting reads Wine Tasting.

Source: proposal_templates.view.lookml L77-79
dating_platform/proposal_templates.view.lookmlL77-79
  - dimension: meta_title    hidden: true    sql: ${TABLE}.meta_title  - dimension: name    type: string    sql: COALESCE(${TABLE}.name, INITCAP(REPLACE(${TABLE}.slug, '-', ' ')))  - dimension: official    type: yesno    sql: ${TABLE}.official

dating-platform, proposal_templates.view.lookml, lines 77-79

Explored under another name

Trust: Source-defined

The enterprise model exposes this view as the date_ideas explore and joins propositions on proposition_template_id.

Source: enterprise.model.lookml L49-54
dating_platform/enterprise.model.lookmlL49-54
  - join: messages    sql_on: messages.proposition_id = propositions.id    fields: []- explore: date_ideas  view: date_ideas  from: proposition_templates  joins:  - join: propositions    sql_on: propositions.proposition_template_id = date_ideas.id- explore: tests  view: user_metrics  label: Test Metrics

dating-platform, enterprise.model.lookml, lines 49-54

What can change the answer 3

Caution: Template counts fan out in date_ideas

Trust: Inferred

date_ideas joins propositions with no relationship, so Looker assumes many_to_one. One template has many propositions, so template rows repeat and are not deduplicated.

What goes wrong: Template count turns into a proposition count as soon as a propositions field is selected.

Read the guide: Join fanout

Source: enterprise.model.lookml L49-54
dating_platform/enterprise.model.lookmlL49-54
  - join: messages    sql_on: messages.proposition_id = propositions.id    fields: []- explore: date_ideas  view: date_ideas  from: proposition_templates  joins:  - join: propositions    sql_on: propositions.proposition_template_id = date_ideas.id- explore: tests  view: user_metrics  label: Test Metrics

dating-platform, enterprise.model.lookml, lines 49-54

Caution: featured is both a yes/no and a time group

Trust: Source-defined

featured is a yes/no dimension over featured, and featured is also declared as a dimension_group over featured_at.

What goes wrong: References to featured can land on the flag or on the timeframes, so filters may not mean what the author intended.

Source: proposal_templates.view.lookml L40-50
dating_platform/proposal_templates.view.lookmlL40-50
    - week    - month    sql: ${TABLE}.expires_on  - dimension: featured    type: yesno    sql: ${TABLE}.featured  - dimension_group: featured    type: time    timeframes:    - time    - date    - week    - month    sql: ${TABLE}.featured_at  - dimension: global    type: yesno    sql: ${TABLE}.global

dating-platform, proposal_templates.view.lookml, lines 40-50

Note: Table name built on the TABLE placeholder

Trust: Inferred

sql_table_name: ${TABLE}.proposition_templates uses ${TABLE} inside its own definition, as the messages view does.

Source: proposal_templates.view.lookml L1-3
dating_platform/proposal_templates.view.lookmlL1-3
- view: proposition_templates  sql_table_name: ${TABLE}.proposition_templates  fields:  - dimension: id    primary_key: true    type: int

dating-platform, proposal_templates.view.lookml, lines 1-3

Parser checks 1

Trust: Source-defined

Mechanical findings from parsing the LookML. They are facts about the files. The cards above explain which ones matter.

Show all 1 check
  • name-collision 1
    • proposal_templates.view.lookml:43 proposition_templates.featured is declared as both dimension and dimension_group.

Related

Guides built on this file

Related source files

Source model