But when I try to add the conditions using Add criteria to group, I get it differently. As you can see the having clause is missing. Not sure how to do it. Add initial events also doesn’t help. There aren’t any more buttons to experiment. So I guess am making some mistake in defining this
The group has a dropdown (where you have your choice of adding another condition, drug exposure, etc), and it is in this ‘add criteria to group’ dropdown is an option to ‘Add Group’.
Intial events do not have a group function: each initial event criteria you define means an ‘or’ across all the entery events; I hope this makes sense: if you made it an and of event A, B and C, what date would you use? Don’t even think of entry events as a ‘boolean’ operation…entry events just says ‘use these events for cohort entry’.
Within a criteria, you can also define a correlated criteria by adding ‘nested criteria’. This will give you a group which to add correlated criteria to the criteria of which the nest belongs to.
Final note on criteria groups: the entire group needs to be an AND or an OR. In other words, you don’t do A OR B AND C OR D AND E
… you do: (A OR (B AND C) OR (D AND E))