Skip to content

Commit

Permalink
Merge pull request #473 from SoryRawyer/rds/time-filter-problem-eng-tab
Browse files Browse the repository at this point in the history
fix: consistently apply datetime filter on problem engagement tab (FC-0033)
  • Loading branch information
bmtcril authored Oct 16, 2023
2 parents 66f4153 + 83dd43e commit 6a2a65f
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ WITH problem_responses AS (
0 AS num_hints_displayed,
0 AS num_answers_displayed
FROM int_problem_results
WHERE 1=1
{% raw %}
{% if from_dttm is not none %}
and emission_time > '{{ from_dttm }}'
{% endif %}
{% if to_dttm is not none %}
and emission_time < '{{ to_dttm }}'
{% endif %}
{% endraw %}
UNION ALL
SELECT
org,
Expand All @@ -96,6 +105,14 @@ WITH problem_responses AS (
caseWithExpression(help_type, 'answer', 1, 0) AS num_answers_displayed
FROM {{ DBT_PROFILE_TARGET_DATABASE }}.int_problem_hints
WHERE 1=1
{% raw %}
{% if from_dttm is not none %}
and emission_time > '{{ from_dttm }}'
{% endif %}
{% if to_dttm is not none %}
and emission_time < '{{ to_dttm }}'
{% endif %}
{% endraw %}
{% include 'openedx-assets/queries/common_filters.sql' %}
)

Expand Down

0 comments on commit 6a2a65f

Please sign in to comment.