AddWorkdays Quicksight calc field function not working

0

Code: addWorkDays(truncDate('MM',{datanet_run_date}),9)

Lets say month is December 2023. AddWorkdays('2023-12-01',9) outputs 2023-12-14 which is not 9 workdays? It is 10.

asked 5 months ago93 views
1 Answer
0

Please note that December 1st was on a Friday. So December 2nd, 3rd, 9th and 10th are not work days. So you have 4 non work days, then if you calculate 1 (first day of the month) + 9 (numWorkDays) + 4 (non work days) = 14.

The table below may make it easier to visualize the calculation. numWorkDays is 0 for December 1st as it is the starting point:

DayWeekdaynumWorkDays
December 1stFriday0
December 2ndSaturday0
December 3rdSunday0
December 4thMonday1
December 5thTuesday2
December 6thWednesday3
December 7thThursday4
December 8thFriday5
December 9thSaturday5
December 10thSunday5
December 11thMonday6
December 12thTuesday7
December 13thWednesday8
December 14thThursday9
AWS
Vitor B
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions