updated monthly_aggregated_metrics_history_by_deal
This commit is contained in:
parent
1e37d04f72
commit
696ac24e35
2 changed files with 28 additions and 46 deletions
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
This macro provides a boolean answer to the question:
|
||||
- Is this date before the previous month?
|
||||
The computation is based on the current date by using now()
|
||||
|
||||
Inputs:
|
||||
- date: the date from which you want to check
|
||||
Output:
|
||||
- boolean; true for is before the previous month
|
||||
false for is not before the previous month
|
||||
*/
|
||||
{% macro is_date_before_previous_month(date) %}
|
||||
(
|
||||
date_trunc('month', ({{ date }})::date)::date
|
||||
+ interval '1 month'
|
||||
)::date
|
||||
< date_trunc('month', now())::date
|
||||
{% endmacro %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue