Home > Expression Operators > Date Operators > #BCDATE > Is something TRUE at every Benefit Commencement Date?

Is something TRUE at every Benefit Commencement Date?

Asking if something is true at every Benefit Commencement Date is the same as asking if something is false at any Benefit Commencement Date. And, sometimes it is easier to determine ALL true (count all the trues) and sometimes it is easier to determine ANY false (and use #GETVALUE).

So, if we wanted to know if someone’s cash balance (CB) is greater than $20,000 at every Benefit Commencement Date, we could either check that directly (is CB > 20000 at every BCD) or indirectly (is CB < 20000 at any BCD). It turns out, in this case, that the indirect method is the simplest way:


BCDs_DT:= #BCDATE 99 & ; get all the Benefit Commencement Dates (a date for each calculation date, zero until the first BCD)
C:= (20000 > CashBalance) #AND (BCDs_DT = #DATES) & ; is the CB less that 20000 on any BCD?
; 0 at most calculation dates; equals 1 only on BCDs where the CB is less than $20000

Flag:= #GETVALUE C & ; zero or the last non-zero value in C
; if Flag is 1 (scalar), then the CB was less than 20000 on at least one BCD