Rules¶
When a User combines their created Conditions it builds a rule for a segment.
Note
Currently Cubed does not support Rules relying on each other. This will be added in the future.
segmenter_rule
id | segmenter_id | pattern | active | created | updated |
---|---|---|---|---|---|
1 | 1 | (1 and 2) | 1 | '2020-08-14 14:09:47' | ['2020-08-14 14:09:47' |
2 | 2 | 1 | 1 | '2020-08-14 15:09:47' | ['2020-08-14 15:09:47' |
3 | 2 | 1 or 4 | 1 | '2020-08-14 17:09:47' | '2020-08-14 17:09:47' |
Pattern¶
A pattern is a conditional statment to be evaluated to true or false. It is built of segmenter_condition
Ids and must be a legal conditional statement.
We recommend to follow where possible that all AND
statements be wrapped in their own brackets, so they can return a bool value either side of an OR
. This is not a strict rule, but when each number is replaced by True or False in python, it needs to be able to evaluate correctly for whatever the user expects.
The following are all legal patterns:
1
(1)
(1 and 2)
1 and 2
(1 and 2) or 3
(1 and 2) or (3 and 4)
1 or 3
1 and (2 or 3)