function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Matt FolgerMatt Folger 

How to aggregate the following data for a report

Hi, I have an app that I'm developing that needs a report/dashboard built for visual representation of where these certain processes ("RPPs") are past along to various departments in our system.  These RPPs start at Dept. 1 and go to Dept. 9 through their 'journies'.  

What I need is a way to view the movement of these fields in an aggregated form.  So I can't just derive the information from the field itself in a report (because each one cooresponds with an individual record) but I need to be able to count the instances of each variable in that field, across the entire object, then report the levels of those various numbers in a visual representation.

So if Dept. 5 had 14 "RPPs" and Dept. 8 had 39 "RPPs" and Dept 9. had 4 "RPPs" then the report would show a bar-graph representing where the processes "RPPs" were "stuck" or built-up along the way.
Best Answer chosen by Matt Folger
AshwaniAshwani
There are SOQL Aggregate query by which you cab groub data by count, sum etc with particular field. SOQL has group by clause by which you can group data to visualize as bar chart.

http://stackoverflow.com/questions/12063240/soql-aggregate-query-count-number-of-rows-returned

http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_agg_fns.htm

All Answers

AshwaniAshwani
There are SOQL Aggregate query by which you cab groub data by count, sum etc with particular field. SOQL has group by clause by which you can group data to visualize as bar chart.

http://stackoverflow.com/questions/12063240/soql-aggregate-query-count-number-of-rows-returned

http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_agg_fns.htm
This was selected as the best answer
Matt FolgerMatt Folger
This is close, but what I need is really like an 'instance count' of HOW many times each variable occurs in the total amount of records.  For example if my record set for all my records of the RPP_Tracker (object in question) are like below.

5
5
5
7
1
9
3
2
8

5


Then I would expect the results to count five 5s, a single 7, a single 1, etc.  Then I could graph this information.  

The reason this would be able to work (in theory) is that these aren't user inputed values, they just are numbers that coorespond to the deptarment that the RPP Tracker item is presently assigned to and it's automated through a formula field.  So the numbers are integers and are always between 0 and 9 (as we have 9 departments through which this process passes).  

So I'm curious as to how this could be done.  Obviously it is not going to be something specific to the object, but for that information to be aggregated and stored elsewhere clearly would define the declaration of probably 9 variables (one for each).  Does anyone know where I should start looking for such a solution?

Matt FolgerMatt Folger
I used the first link you posted to create a variable for each record count filter (Dept's 1-9), then I can use those variables to graph to my heart's content.