Inaccessible view error when joining a view with a "from" parameter

The problem is that I have a measure that is defined in a refined view that then is joined into an explore. This refined view borrows a field from another view, which is fine, however when I join the final view in with different name than the original (this is where “from” parameter comes in), it the validator will throw an error..

The error

Inaccessible view "pricespec__base" referenced in "first_pricespec__price.num__ppw__incl_vat__loc". "pricespec__base" is not accessible in explore "project". Check for missing joins in explore "project".

LookML for refined views

view: +pricespec__base {}

view: +pricespec__price {

# PPW incl. VAT
measure: num__ppw__incl_vat__loc {
group_label: "Price Summary"
group_item_label: "AVG PPW (LOC) incl. VAT"
label: "Average Price Per Watt (LOC) incl. VAT"
type: number
sql: ${sum__gross_price__incl_vat__loc} / nullif(${pricespec__base.sum__nominal_panel_power}, 0 ;;
}

}

LookML for the explore (this works)

  join: pricespec__base {
view_label: "Project's Contracts"
type: left_outer
sql_on: ${contract.dim__pricespec_id} = ${pricespec__base.dim__id} ;;
relationship: one_to_one
}

join: pricespec__price {
view_label: "Project's Contracts"
type: left_outer
sql_on: ${pricespec__base.dim__id} = ${pricespec__price.dim__pricespec_id} ;;
relationship: one_to_many
}

LookML for the explore (this throws an error)

  join: first_pricespec__base {
from: pricespec__base
view_label: "Project's Contracts"
type: left_outer
sql_on: ${contract.dim__pricespec_id} = ${first_pricespec__base.dim__id} ;;
relationship: one_to_one
}

join: first_pricespec__price {
from: pricespec__price
view_label: "Project's Contracts"
type: left_outer
sql_on: ${first_pricespec__base.dim__id} = ${first_pricespec__price.dim__pricespec_id} ;;
relationship: one_to_many
}

The problem I’m solving with usage of “from” parameter in the joins is that I need to join in the same refined view multiple times with different “sql_on” configuration. It seems LookML is trying to find a view by “first_pricespec__base” and not what is specified in the `from` parameter “pricespec__base”

How would someone join a refined view that uses a “calculated” field from multiple views and then needs to join it in same explore multiple times?

Surely there must be a way! 😞

1 5 1,334
5 REPLIES 5
Top Labels in this Space
Top Solution Authors