0

I would like to seek some help on how to effect the below results, using infopath "calculated value". Based from the "SubmitDate" field, the infopath "calculated field" should provide the week number of "SubmitDate" it falls under...where Week 1 starts 01 January, and week days starts Sunday-Thursday

example

SubmitDate WeekNo (calculated value)
01/01/2020 Week 1
05/01/2020 Week 2
09/01/2020 Week 2

System:
Infopath 2013
SharePoint 2013

Thank you.

0

First, You need to calculate FirstDayOfSubmitYear from SubmitDate: concat(substring-before(SubmitDate, "-"), "-01-01")
Then calculate NumberOfDaysBetweenFirstDayAndSubmitDate: concat(substring-before(., ";") + substring-after(., ";") * ((translate(xdDate:AddDays(../my:startDate, substring-before(., ";")), "-", "") < translate(../my:endDate, "-", "")) * 2 – 1), ";", substring-after(., ";") div 2)
Then finally divide that number of days by 7 and round to the nearest integer: round(NumberOfDaysBetweenFirstDayAndSubmitDate / 7)

| improve this answer | |
  • thank you for your help. Being very new to this, i am having some difficulty combining the calculations (formula) you've provided in infopath calculated field, and throws an error when "verify formula". – MarjuN Jan 30 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.