You are viewing limited content. For full access, please sign in.

Question

Question

Forms - Advanced Calculation Challenge Related to Date Function

asked on January 13, 2021

I was wondering if anyone had a better way to compare the date to the fiscal year. For example, I'm building a form that allows employees to submit receipts and cost to be reimbursed. I would have two fields - receiptDate and receiptCost. These two fields are in a collection and a field outside of this collection does =sum(collection.receiptCost) for total claims.

 

Every year in the month of January - there may be submissions of a December (of the previous year) purchase that is reimbursable until January 31st of the current year. I'd like for them to submit all receipts, whether it's in the last calendar or the current calendar year but be able to calculate and split the reimbursement out to two additional fields - one for "last calendar year reimbursement) and one for "this calendar year's reimbursement".

 

There's only a max of $1000 reimbursement per calendar year and this is the reason why we have it split up so they can maximize the reimbursement claims.

 

 

I'd appreciate any feedback on the logic that needs to be applied to the date/month in the calculated field for the collection of items.

 

0 0

Replies

replied on January 14, 2021 Show version history

Hi there,

I am not familiar with the concept of fiscal year. While from my understanding, you want to calculate sum of receipt cost based on year of its receipt date, right?

My approach is to have a hidden field inside collection receiptDate_YEAR to calculate year for each receipt date by formula, e.g. =YEAR(INDEX(Collection.receiptDate,ROW()))

Then you can calculate the sum of cost based on receipt year by formula, e.g. =SUMIF(Collection.receiptDate_YEAR, CurrentYear, Collection.receiptCost), where CurrentYear is the calendar year you want to calculate. You can also set another hidden field to get last/current calendar year instead of hard-code it.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.