Reporting on Account Hierarchies

Recently I was asked to create a report to show Account Hierarchies in Salesforce. Sounded easy enough so I created an Account Summary report grouping by Parent Account name.  The problem with this is the org has multiple hierarchy levels so the report doesn’t reflect this.  Accounts are shown more than once – you can’t see the hierarchy properly.

Account Hierarchies1

To get around this I created a custom report type.  Before you do this, make sure you don’t already have a custom report type you could use.  Custom report types can mushroom before you know it!

Custom reports can be found in Setup>Create>Custom Report Types

In this example I chose Accounts as my Primary Object.  Tip – Always enter a description to make it easier to remember what this report type is for.  I also chose “In Development” – that way it is only available to system administrators until I am sure that it’s ready for my users.

Account Hierarchies2

For this report there is no need to relate it to another object so just save it.

Now you can add the Parent Account fields. Click on Edit Layout.  On the right in the View box click on Add fields related via lookup.

Account hierarchies3

Click on Parent Account and you’ll get all the Parent Account fields to choose from.  For this report I’ve chosen Account Name, Account Number and Account Record Type.

AccountHierarchies4

I’ve also chosen Parent Account so that I can go higher up the hierarchy.

AccountHierarchies5

Clicking on View Related fields again means you can choose Account Name, Account Number and Account Record type again.  You can do this for up to 5 levels in the hierarchy.

Save your layout and now you can use it.

Here’s one of the reports I created – it’s not as easy on the eyes as the real account hierarchy but it works.

AccountHierarchies6

I welcome any comments you have on this post. Check back for further ramblings in the future!

Update 10/21/2015

Here’s another take on this – thanks Steve Mo!

https://success.salesforce.com/answers?id=90630000000ChkPAAS


Leave a comment