Forum Discussion

MeredithMoore1's avatar
MeredithMoore1
Qrew Cadet
8 years ago

Tasks, Holidays, and Predecessors not working well together

Ok, so I have scoured the pages here and gotten bits and pieces about how to deal with holidays in my tasks. However, I have not found a way to deal with tasks that are part of a series of tasks that contain predecessors. This is a big problem. 

I need my tasks to not start or end on a holiday, and if there is a holiday in the duration of the task, I need it to add a workday to compensate. I need the start date of each task to be editable, as well as the duration. 

So far I have done the following and it has not produced the result I desire. 

******
1) Made a table called Holidays. It is a single line table.


2) Added the following code to the Projected FinishX:

var date thanksd            =[Holiday - 17Thanks];

var date thanksp            =[Holiday - 17Thanks2];

var date christe            = [Holiday - 17ChristE];

var date christd            = [Holiday - 17ChristD];

var date newyearse            =[Holiday - New Years Eve];

var date newyearsd            =[Holiday - New Years Day];

var date easter            = [Holiday - Easter-GF];

var date memorial            = [Holiday - Memorial Day];

var date julyth            = [Holiday - July 4];

var date laborday              = [Holiday - Labor Day];

var date thanksgivingt = [Holiday - Thanksgiving T];

var date thanksgivingf        = [Holiday - Thanksgiving F];

var date christmase            = [Holiday - Christmas Eve];

var date christmasd            = [Holiday - Christmas Day];


var number a = [Duration];

var date start = ToDate([Start]);


var number b = $a + If($thanksd >= $start and $thanksd <= WeekdayAdd($start, $a), 1, 0);

var number c = $b + If($thanksp >= $start and $thanksp <= WeekdayAdd($start, $b), 1, 0);

var number d = $c + If($christe >= $start and $christe <= WeekdayAdd($start, $c), 1, 0);

var number e = $d + If($christd >= $start and $christd <= WeekdayAdd($start, $d), 1, 0);

var number f = $e + If($newyearse >= $start and $newyearse <= WeekdayAdd($start, $e), 1, 0);

var number g = $f + If($newyearsd >= $start and $newyearsd <= WeekdayAdd($start, $f), 1, 0);

var number h = $g + If($easter >= $start and $easter <= WeekdayAdd($start, $g), 1, 0);

var number i = $h + If($memorial >= $start and $memorial <= WeekdayAdd($start, $h), 1, 0);

var number j = $i + If($julyth >= $start and $julyth <= WeekdayAdd($start, $i), 1, 0);

var number k = $j + If($laborday >= $start and $laborday <= WeekdayAdd($start, $j), 1, 0);

var number l = $k + If($thanksgivingt >= $start and $thanksgivingt <= WeekdayAdd($start, $k), 1, 0);

var number m = $l + If($thanksgivingf >= $start and $thanksgivingf <= WeekdayAdd($start, $l), 1, 0);

var number n = $m + If($christmase >= $start and $christmase <= WeekdayAdd($start, $m), 1, 0);

var number o = $n + If($christmasd >= $start and $christmasd <= WeekdayAdd($start, $n), 1, 0);


ToWorkDate(WeekdayAdd($start, $o))


This is the result: (see those holidays?)


  • What's the point of using these long QuickBase formulas which are vastly more complicated than script but severely limited? Just use script and I am sure it is trivial to implement.