# [FTA_IN REVIEW] Conditional logic – does a list item appear in a subset?

Subsets are invaluable in creating dynamic and efficient models in Anaplan.  Typical use sees them being used as a dimension in a module, where only the subset is relevant.

Take, for example, a List named Employee containing a list of all employees in your organisation. Employees are either Sales Executives or Engineers:

A Module for holding Sales Quotas by Employee would use the Sales Executive Subset as the Module dimension.  This logically correct, ensuring that sales quotas are not inadvertently stored for Engineers.  Moreover, this helps to manage the Model size by ensuring redundant data (i.e. sales quotas for Engineers) is not stored.

The challenge comes when you want to use conditional logic in a Line Item and use a formula that produces a different result depending on whether a List Item appears within a subset or not.

In our example, let’s say we’re modelling Headcount Expenses by Employee and all Sales Executives receive a car allowance of \$10,000 per annum.  We need a way of determining whether an Employee is in the Sales Executive subset or not.

There is no standard Anaplan Formula to achieve that, and the screenshot below shows how to achieve this.  Please note the following:

1. We calculate two Boolean line items – is Sales Executive? And is Engineer?
2. These are Line Items in the Employee Details SYS module. Note – this is best practice, in contrast to storing the results as Properties of the List.
3. Whilst the module is dimensioned on Employee, the Applies To field of each line item is set to the corresponding Subset
4. Each Line Item is hard-coded to TRUE which, mixed with the Applies To restriction on the Subset ensures that only items in that Subset are set to TRUE.

You can see from the screenshot below that the Booleans calculate correctly, showing which Subset each Employee is a member of.

You can then go on to refer to the two Boolean Line Items in this Employee Details SYS modules in the normal way:

That is so cool. What a clean way to obtain the members of a list subset.

And it follows the DISCO method too! Brilliant!

Can this method be used to balance a ragged list somehow? Sometimes all that's needed is the child level and the parent within all those levels.

Anyway, this is going in my personal Planual.

Thanks @Jared Dolich , glad you like it!

Interesting point about ragged hierarchies - I'll put a bit of thought to that.

Contributors
Latest Articles
7 hours ago
by Misbah
yesterday
a week ago
Labels (1)