Page 1 of 1

How to SUM between a Date Range?

Posted: Tue Sep 05, 2023 10:04 pm
by ericp
Please see the screenshot. I have a table with years associated to values. I want to separate the SUM of 'All Years' vs 'Active Years'. For example if I say my 'Active Years 'are between 2020 and 2024, how can create the formula to ignore the values with the Year 2019?

Re: How to SUM between a Date Range?

Posted: Tue Sep 05, 2023 11:01 pm
by Lech Kulikowski
Hello,

Please try to use the SumIf() function. Something like:
SumIf(datasource.column, (datecolumn >= 2020 && datecolumn <= 2024))

Thank you.

Re: How to SUM between a Date Range?

Posted: Tue Sep 05, 2023 11:11 pm
by ericp
So this is the function I tried (in the Total column) and it doesn't seem to be working:

{SumIf(currentProjectRevision_ProjectRevisionFunding.Total), >=(currentProjectRevision.FiscalyearStart) && <=(currentProjectRevision.FiscalYearEnd)}

My datasource:
currentProjectRevision.FiscalyearStart = "2020"
currentProjectRevision.FiscalYearEnd = "2024"

Re: How to SUM between a Date Range?

Posted: Wed Sep 06, 2023 10:16 am
by Lech Kulikowski
Hello,

Your expression is not correct, should be:
{SumIf(currentProjectRevision_ProjectRevisionFunding.Total, (YOURDATACOLUMN >=currentProjectRevision.FiscalyearStart && YOURDATACOLUMN <= currentProjectRevision.FiscalYearEnd))}

Thank you.