Unknown or inaccessible field when following PoP tutorial (again!)

I’m following up on my previous question as I have two other Unknown or inaccessible field error that seems to be different (not related to refinement).

the first one is:
 

Unknown or inaccessible field "daily_pages.date_month_of_quarter_advanced" referenced in "daily_pages.is_to_date_advanced". Check for typos or append a timeframe to the name if the field is type "time".

I have this error because of these lines of codes 

  dimension: is_to_date_advanced {
hidden: yes
type: yesno
sql:
{% if parameters.select_timeframe_advanced._parameter_value == 'ytd' %}true
{% else %}
{% if parameters.apply_to_date_filter_advanced._parameter_value == 'true' %}
{% if parameters.select_timeframe_advanced._parameter_value == 'week' %}
${daily_pages.date_day_of_week_index} <= ${parameters.current_timestamp_advanced_day_of_week_index}
{% elsif parameters.select_timeframe_advanced._parameter_value == 'day' %}
${daily_pages.date_hour_of_day} <= ${parameters.current_timestamp_advanced_hour_of_day}
{% elsif parameters.select_dynamic_timeframe_advanced._parameter_value == 'quarter' %}
${daily_pages.date_month_of_quarter_advanced} <= ${parameters.current_timestamp_month_of_quarter_advanced}
{% elsif parameters.select_timeframe_advanced._parameter_value == 'year' %}
${daily_pages.date_day_of_year} <= ${parameters.current_timestamp_advanced_day_of_year}
{% else %}
${daily_pages.date_day_of_month} <= ${parameters.current_timestamp_advanced_day_of_month}
{% endif %}
{% else %} true
{% endif %}
{% endif %}
;;
}

and especially this dynamic variable: ${daily_pages.date_month_of_quarter_advanced}

 what does date_month_of_quarter_advanced mean here? I’ve seen that it’s not available in the timeframes option of my dimension group date. 

the second error is:

Unknown or inaccessible field "daily_pages.date" referenced in "daily_pages.current_vs_previous_period_advanced". Check for typos or append a timeframe to the name if the field is type "time".

this error is because these lines of code: 

  dimension: current_vs_previous_period_advanced {
label: "Current vs Previous Period"
hidden: yes
description: "Use this dimension alongside \"Select Timeframe\" and \"Select Comparison Type\" Filters to compare a specific timeframe (month, quarter, year) and the corresponding one of the previous year"
type: string
sql:
{% if parameters.select_timeframe_advanced._parameter_value == "ytd" %}
CASE
WHEN ${daily_pages.date} BETWEEN DATE_TRUNC(DATE_TRUNC(${parameters.selected_reference_date_default_today_advanced_raw}, YEAR), MONTH) AND DATE_TRUNC(${parameters.selected_reference_date_default_today_advanced_raw}, DAY)
THEN ${selected_dynamic_timeframe_advanced}
WHEN ${daily_pages.date} BETWEEN DATE_TRUNC(DATE_TRUNC(DATE_SUB(${parameters.selected_reference_date_default_today_advanced_raw}, INTERVAL 1 YEAR), YEAR), MONTH) AND DATE_TRUNC(DATE_SUB(${parameters.selected_reference_date_default_today_advanced_raw}, INTERVAL 1 YEAR), MONTH)
THEN ${selected_dynamic_timeframe_advanced}
ELSE NULL
END
{% else %}
{% if parameters.select_comparison._parameter_value == "year" %}
CASE
WHEN DATE_TRUNC(${daily_pages.date_raw}, {% parameter parameters.select_timeframe_advanced %}) = DATE_TRUNC(${parameters.selected_reference_date_default_today_advanced_raw}, {% parameter parameters.select_timeframe_advanced %})
THEN ${selected_dynamic_timeframe_advanced}
WHEN DATE_TRUNC(${daily_pages.date_raw}, {% parameter parameters.select_timeframe_advanced %}) = DATE_TRUNC(DATE_SUB(${parameters.selected_reference_date_default_today_advanced_raw}, INTERVAL 1 YEAR), {% parameter parameters.select_timeframe_advanced %})
THEN ${selected_dynamic_timeframe_advanced}
ELSE NULL
END
{% elsif parameters.select_comparison._parameter_value == "period" %}
CASE
WHEN DATE_TRUNC(${daily_pages.date_raw}, {% parameter parameters.select_timeframe_advanced %}) = DATE_TRUNC(${parameters.selected_reference_date_default_today_advanced_raw}, {% parameter parameters.select_timeframe_advanced %})
THEN ${selected_dynamic_timeframe_advanced}
WHEN DATE_TRUNC(${daily_pages.date_raw}, {% parameter parameters.select_timeframe_advanced %}) = DATE_TRUNC(DATE_SUB(${parameters.selected_reference_date_default_today_advanced_raw}, INTERVAL 1 {% parameter parameters.select_timeframe_advanced %}), {% parameter parameters.select_timeframe_advanced %})
THEN ${selected_dynamic_timeframe_advanced}
ELSE NULL
END
{% endif %}
{% endif %}
;;
}

I don’t understand why daily_pages.date is not accessible when for example daily_pages.date_raw is working correctly. daily_pages is the name of my view and date is the name of my group dimension date…

Thanks. 

P.S I’m not sure I should be grouping two questions like this. I hope it’s fine!

Solved Solved
0 1 480
1 ACCEPTED SOLUTION

I believe you need it to be created_month_of_quarter_advanced because this is the special field that’s not part of the dimension group.

Second error: try daily_pages.date_date

View solution in original post

1 REPLY 1

I believe you need it to be created_month_of_quarter_advanced because this is the special field that’s not part of the dimension group.

Second error: try daily_pages.date_date

Top Labels in this Space
Top Solution Authors