Hi - I am trying to write a beast mode calculation that sums a field from an as of date until the end of the year. The variable is indexed across the year and want to count how many are left depending on what date is entered. For instance if 1/22/24 was the date it would count all the values indexed for the variable until 12/31/24 and so on.
Here is what I have but doesnt seem to fully work.
SUM(CASE WHEN index
>= date
AND index
<= LAST_DAY(CURRENT_DATE() + INTERVAL (12 - MONTH(CURRENT_DATE())) MONTH) THEN (variable
) END)