Questions tagged [aggregate]

The tag has no usage guidance.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
58 views

Is applying a LIMIT to a Count() query an optimization?

Salesforce has recently updated the way that the Apex Governor counts Count() query row limits so that the entire aggregate is a single SOQL Row (as opposed to previously where each aggregated row was ...
1
vote
1answer
31 views

SOQL Get child with most rows grouped by parent

Let's say i have the following structure Object Car is a parent of many (object) Incidents that are also children of an Area So the table of incidents looks like this INCIDENTS ID CAR AREA ...
1
vote
0answers
45 views

Aggregate query on After Insert returns null

I am working on a class that will identify if an account has a primary contact when an contact is inserted or updated.trigger is on contact to fire on after update/After insert. private void ...
1
vote
0answers
85 views

using aggregate query to iterate on vf page

I have the following code: for(table1__c t1 :[Select id,form__c,type__c from table1__c where formation__c=:set_formation limit 10000]){ //create a map of form,list table1 if(map_table1_form....
1
vote
1answer
109 views

What is the governor limit on aggregate query rows when using Force.com SOAP or REST APIs?

I would like to get the record count from each object (there are fair chances of getting more than 50K records) using a desktop utility and would like to create one CSV file for each object's record ...
1
vote
2answers
88 views

How to sort when we use aggregate function?

I have a formula field that orders a particular field values. Example: A field for employees profession, for each profession there is an equivalent number value like, "IT = 1, Doctor = 2". I'm using ...
1
vote
0answers
102 views

Aggregating Results: Not grouping properly

I have a query onto the OpportunityLineItem table. AggregateResult[] OppLineItemsPlays = [select OpportunityId, PricebookEntry.Product2.Play__c, COUNT(id) ...
0
votes
0answers
8 views

Aggregate Cumulative

It is possible to cumulate the aggregate results? My code below works fine so far, I get for each month a sum of BWS but now I need the cumulative value. For example: January BWS - 100 February ...
0
votes
0answers
21 views

Put Aggregateresult in Chart

I want to count the number of consultingdays each month from the current year. And I want add this values into a line chart. But it doesn't work. If I run the visualforce page I get the error field '...
0
votes
1answer
24 views

Can you include only top 10 records in SOQL group?

I have the following Query [Select Supplier__c, Avg(Total_Sales__c) from Submittal group by Supplier__c order by Purchase_Date__c DESC] The issue is that I only want to include the latest 10 records ...
0
votes
2answers
42 views

Manual Rollup (Sum) behaving differently than Reports and AggregateResult Sum

I'm not sure what is going on here. I'm wrote/summed up some anonymous apex to demonstrate some the discrepancies I'm seeing. Sometimes the values are accurate, sometimes close, sometimes just way off....
0
votes
1answer
37 views

Extract aggregratelist value where conditions are met

I need some continued help with this project. I have my aggregrateResult list with the needed data for every account. How do I pull the data just for the current account? global class ...
0
votes
0answers
109 views

Update Object with unique values from Child object using Aggregate result

I am trying to update a field on the Quote (Operational_Start_Date__c) from the results of an aggregate result query. The trigger runs on quote, queries QuoteLine for unique values and update the ...
0
votes
0answers
39 views

Opportunity analyze

I need an analyze of our opportunities for each team in our org. First I select the team and then should the visual page show a table of all accountOwner of this team and the different recordtypes (...
0
votes
0answers
390 views

Currency Conversion Issue

I am working on a OptyLineItem trigger that does a rollup summary on the Opty header of a custom currency field on the OptyLineItem. The default currency is USD and Advanced Multi-currency is enabled....
0
votes
1answer
99 views

Aggregated Results Unknown Property

I have the following code but the aggregate-result doesn't work. I pretty much want to return back the number of active users in the system. How do I return the Count(*) of all the active users? Class ...