I have created a Query Calculation to total ([dms].[inv].[tot_net_amt]). However, I only want it to total that value if [dms].[inv].[trans_date] is during a given calendar year (i.e., 2018, 2019, etc.). What is the best approach to create this expression?
I have created a Query Calculation to total ([dms].[inv].[tot_net_amt]). However, I only want it to total that value if [dms].[inv].[trans_date] is during a given calendar year (i.e., 2018, 2019, etc.). What is the best approach to create this expression?
easiest way would be to do total(case when [dms].[inv].[trans_date] in (2018, 2019) then [dms].[inv].[tot_net_amt] else 0 end )