I am trying to get a quarterly view of a value where Q1 and Q2 are full quarters and Q3 is a year-to-date calculation. So my table is showing Quarters as rows. But when I try to pull the data using a beast mode like below, I get errors because I'm using the SUM aggregation with the MAX for the date (or the number of days). Is there a way to do this where I can apply the MAX portion of this to only Q3 and thus not have the aggregation conflict?
sum(case when `ATTRIBUTE A` = 'Condition A' and `ATTRIBUTE B` = 'Condition B' then
case when `QUARTER` = 'Q1' then `Value`
when `QUARTER` = 'Q2' then `Value`
when `QUARTER` = 'Q3' then ((`Value`/90) * max(datediff(case when `ATTRIBUTE A` = 'Condition A' then `DATE` end,'2018-01-01')))
END
END )