Skip to content

Commit

Permalink
Update your_model.model.lkml
Browse files Browse the repository at this point in the history
update to match datatypes in order file
  • Loading branch information
ajcrutch committed Feb 13, 2020
1 parent 0fbec46 commit cfb769d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions your_model.model.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ explore: your_view_name {
#---- Add in this sql_always_where clause replacing your_view_name
sql_always_where:
{% if your_view_name.current_date_range._is_filtered %}
{% condition your_view_name.current_date_range %} TIMESTAMP(${event_date}) {% endcondition %}
{% condition your_view_name.current_date_range %} ${event_raw} {% endcondition %}

{% if your_view_name.previous_date_range._is_filtered or your_view_name.compare_to._in_query %}
{% if your_view_name.comparison_periods._parameter_value == "2" %}
or
${event_date} between ${period_2_start} and ${period_2_end}
${event_raw} between ${period_2_start} and ${period_2_end}

{% elsif your_view_name.comparison_periods._parameter_value == "3" %}
or
${event_date} between ${period_2_start} and ${period_2_end}
${event_raw} between ${period_2_start} and ${period_2_end}
or
${event_date} between ${period_3_start} and ${period_3_end}
${event_raw} between ${period_3_start} and ${period_3_end}


{% elsif your_view_name.comparison_periods._parameter_value == "4" %}
or
${event_date} between ${period_2_start} and ${period_2_end}
${event_raw} between ${period_2_start} and ${period_2_end}
or
${event_date} between ${period_3_start} and ${period_3_end}
${event_raw} between ${period_3_start} and ${period_3_end}
or
${event_date} between ${period_4_start} and ${period_4_end}
${event_raw} between ${period_4_start} and ${period_4_end}

{% else %} 1 = 1
{% endif %}
Expand Down

0 comments on commit cfb769d

Please sign in to comment.