Posted: 27 Oct 2016 6:45 EDT Last activity: 27 Oct 2016 7:33 EDT
Control Group Strategy Pattern incorrect boolean expression shown in video
In the lesson 'Measure Marketing Effectiveness Using Control Groups', in Segment 4 'Strategy Pattern' video between about 02:04 and 02:20, the boolean expression displayed for deciding whether the control group is inside its validity window contains errors.
In both of the terms containing CurrentDate the arguments to the boolean operator are the wrong way around.
Also the two OR clauses need their precedence raised by wrapping them in brackets.
In boolean algebra (and all computer programming languages that I have used) the boolean operator AND has higher precedence than OR so you need the brackets to make this right.
I believe it should read:
(ControlGroupValidityStart = "" OR CurrentDateTime() >= ControlGroupValidityStart)
(ControlGroupValidityEnd = "" OR ControlGroupValidityEnd >= CurrentDateTime())
(the expression used in the exercise is correct)
I realize this might be a bit arcane for people coming from a marketing background. However people coming from a computing background are just going to be confused.
In the video, the expression is presented only as a reference, just to show the properties, and the values you need to be aware of when testing a Control Group's validity date; it is not to present a technically accurate expression. I guess it could have been abstracted even further, into a plain English statement may be, to avoid giving an impression that this the actual expression.
As you have rightly discovered, the students are expected to use the hands-on exercise to learn the correct expression, with braces and all.