Question

filter a foreign measurement

  • 22 February 2021
  • 0 replies
  • 22 views

Hello, I have to create an array based on the values ​​of a filter on the field of a single view to calculate the measurements of 2 views.I made the join between the 2 views.When I calculate the measurements in the foreign view and apply the view filter. The filter has no influence on the foreign measurementhow could I solve this?thank you
 measure: sum_dig_total_ht {
label: "n"
type: sum
value_format_name: decimal_0
sql: CASE
WHEN {% condition date_filter %} CAST(${date_sales_date} AS TIMESTAMP) {% endcondition %}
THEN ${derived_table_digital_sales.total_ht}
END ;;
}

measure: sum_dig_total_ht_ly {
label: "n-1"
type: sum
value_format_name: decimal_0
sql: CASE
WHEN {% condition date_filter %} CAST(DATE_ADD(DATE(${date_sales_date}), INTERVAL 1 YEAR) AS TIMESTAMP) {% endcondition %}
THEN ${derived_table_digital_sales.total_ht}
END ;;
}

 


0 replies

Be the first to reply!

Reply