macro for create date interval

I have wrote macro ‘{% macro get_two_quarters_ago_end() %}
dateadd(day, - 1, dateadd(‘QUARTER’, - 1, date_trunc(‘QUARTER’, current_date())))
{% endmacro %}’ to calculate dynamic date from two quoters form current quatre
Also I have crated one another macro valuations.
And I want to call this two macros.

The context of why I’m trying to do this

And this macro I want to call in model:
{%- set enddate = ‘2024-06-30’ -%}
with
valuations as ({{
frt_valuations ( enddate )}})
user as (select * from {{ ref(‘abc_user’) }}),

select
a.*
, b.account

from valuations a
left join user b

and instead of hardcode ‘{%- set enddate = ‘2024-06-30’ -%}’ I want to call my macro get_two_quarters_ago_end but this is not possible in my main model. Could you please help me to solve my problem?

why you are not using just the in database function dateadd and go two quarters back?

Note: @Alexander Freickmann originally posted this reply in Slack. It might not have transferred perfectly.