How to Set Up a Count Based on an Attribute
This example will teach you how to set up a count in order to count items in a source module based on specific attributes in that source module.
Anaplan does not contain a 'Count' function like Excel, but it’s very easy to simulate the same behavior. All you need to do is add in a line item called 'Count' and set the formula of the line item to be 1. Then create a new module that is dimensioned by the attributes you want to count over and create a SUM off the count.
Here is a simple example:
Here we have a numbered list that contains a list of emails sent along with their status. I want to be able to count the number of emails sent for each sender (or receiver) based on the status 'sent'.
Steps to count:
- Ensure Sender is formatted as type 'List'.
- Ensure Status is formatted as type 'List'.
- Add a line item to the source module called 'Count'. Format the line item as a number, and set the formula to 1.
- Create a new module called 'Count of Emails' that applies to the email Sender list and the Status list.
- Add a new line item to the module for Count and the formula will be: SourceModule.Count[SUM: SourceModule.Status, SUM: SourceModule.Sender]
In this solution, you will also get the count of how many emails failed.
What if I only want to see the count of Sent Emails?
- Ensure Sender is formatted as type 'List'.
- Add a line item to the source module called Count. Format the line item as a number and set the formula to 'If Status = StatusList.Sent' then 1 else 0'
Note: if Status is formatted as text, this option works the same way. Just set status = "sent" in the if statement.
3. Create a new module called 'Count of Emails' that applies to the email Sender list only.
4. Add a new line item to the module for Count and the formula will be: SourceModule.Count[SUM: SourceModule.Sender]
What if both the sender and status are text values?
This is a more complicated scenario to get an accurate count. Before trying this, evaluate if it’s possible to create a sender list. In this case, we will need to use the RANK function along with sorting of the module to see a count.
- Add a line item to the source module called 'Count'. Format the line item as a number, and set the formula to 1.
- Add a line item to the source module called 'Include?'. Format the line item as a Boolean, and set the formula to 'Status = "sent" ' (Note: Because this is a Boolean line item you do not need to include the IF THEN.)
- Add a line item to the source module called Rank. Format the line item as a number, and use the RANK function with the following arguments:
RANK(Count, DESCENDING, SEQUENTIAL, Include?, Sender)
The keyword SEQUENTIAL makes it so that tied values are assigned separate rankings, in the order they occur. In this case, it will provide a count for each sender.
Include? ensures it is ranking only sent emails that have status = sent.
Sender adds in a grouping element so that it counts each sender individually.
4. You now have the rank for each sender. The highest Rank for each sender is how many emails they have sent. Sort the module by the Rank, and the highest senders will show up first.
This solution should be evaluated before using it on a dashboard for a large group of end users because it might be confusing for end users to review this as the lower-ranked senders will also show up.
Categories
- All Categories
- 2.3K Anaplan Community
- Academy
- Anaplan Talent Builder
- Model Design Course
- The Anaplan Way
- Archive
- 2 Idea exchange
- 62 Enterprise Scale
- 1.1K Extensibility
- 21 Intelligence
- 1.6K Planning & Modeling
- 331 Security
- Community Connections
- Connections
- Experiences
- Groups
- Personas
- Employees
- CS Toolkit
- Customer Care Center
- Forums
- Academy & Training
- Community Feedback & Updates
- Japan
- Anaplan Community Japan
- Anaplan Community Japan Knowledge Base
- HyperCare Japan
- JP-Central
- Support-Japanese
- Partners
- Partner Leadership Council
- Partner Product Council
- 724 Platform
- Anapedia
- App Hub
- Centers Of Excellence
- Extensions
- Planual
- Platform Updates
- 724 User Experience
- Profile Builder
- Resources
- Anaplan Advocates
- Anaplan Live!
- Community
- Community Advancement
- Community Connections
- Partner Program
- The Official Master Anaplanner Program
- Videos
- Welcome to the Anaplan Community!
- Success Central
- Support
- Case Portal Link
- Common Support Questions
- HyperCare Redirect
- Known Issues and Workarounds
- Support test page
- SupportFAQ
- Survey
- 2 Training Day Takeaways