- 06 Aug 2024
- 2 minutes to read
Audience rule set examples
- Updated on 06 Aug 2024
- 2 minutes to read
Date-based rule example
This is an example of using a date-based rule set to add users to your audience. In the example below, the rule being used is the System access rule for Last login date.
For this example you have the following user values:
Username | Last login date |
---|---|
user 1 | 1 Jan 2017 |
user 2 | 3 Jan 2017 |
user 3 | 4 Jan 2017 |
user 4 | 5 Jan 2017 |
You set up an audience rule set of: Before a selected date of 2 Jan 2017.
The results are that only one user would be added:
Username | Last login date |
---|---|
user 1 | 1 Jan 2017 |
Taking the same original data, let's now imagine that the current date is 5 Jan.
You set up a rule set of: Before the previous 2 days.
The result would still be one user:
Username | Last login date |
---|---|
user 1 | 1 Jan 2017 |
So instead you set up a rule of: Within the previous 2 days.
Now three users would be added because of the change of rule from Before to Within:
Username | Last login date |
---|---|
user 2 | 3 Jan 2017 |
user 3 | 4 Jan 2017 |
user 4 | 5 Jan 2017 |
As another example, using the same original data, the current date is 1 Jan 2017.
This time you set up a rule: Within the upcoming 2 days.
You would get a result of two users added to the audience:
Username | Last login date |
---|---|
user 1 | 1 Jan 2017 |
user 2 | 3 Jan 2017 |
Instead, you could set the rule to: After the upcoming 2 days.
In this case, you would still get two users, but they would be different users because of the rule change from Within to After.
Username | Last login date |
---|---|
user 3 | 4 Jan 2017 |
user 4 | 5 Jan 2017 |
Nested audiences
Nested audiences allow you to base a dynamic audience on one or more other audiences using the Audience member rule. This appears under the Audience heading in the normal Add rule dropdown menu.
If you had Audience 1 consisting of users A, B and C, and Audience 2 consisting of users C, D and E, you could configure rules using these audiences in several ways.
You could create a new audience using the rule: Member of 'Audience 1', 'Audience 2' by using the Member of audience rule and then selecting 'Audience 1' and 'Audience 2' from the dialog box.
This would give you an audience with users A, B, C, D and E.
Alternatively, you could create two separate rules (within a single rule set):
Rule 1: Member of 'Audience 1'.
AND:
Rule 2: Member of 'Audience 2'.
This would require the user to be in both audiences, so the new audience would only match user C.
If you have an audience that uses other rules, and you want to add the members from one or more audiences to that group, you would do it like this:
Rule 1: User is a Manager.
OR:
Rule 2: Member of Audience 'Audience 1'.
This audience would include every manager on your site, plus the users in Audience 1 (whether they are a manager or not).
If you want to exclude an audience even if they meet the other criteria, you need to use 'AND' between rules and the 'NOT' operator in the rule:
Rule 1: User is a Manager.
AND:
Rule 2: NOT a Member of Audience 'Audience 1'.
This audience would include every manager, except the managers in Audience 1.
If you need something more complex it may be possible to use rule sets to put together sets of rules, and/or multiple levels of nested audiences.
The Totara Academy has a whole course dedicated to using audiences in Totara. Here you can learn more on how to use audiences, see best practice, and give it a go yourself.
© Copyright 2024 Totara Learning Solutions. All rights reserved.