Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 887
3 votes

Using Aggregate SOQL With Large Amounts of Data (> 500k records)

I note that your query includes: WHERE BI_UPDATE_DATE_MSD__c = 2014-09-01 which may be selective enough to allow your query to work. As Working with Very Large SOQL Queries describes, that term wou …
Keith C's user avatar
  • 137k
2 votes

how to use logic with aggregate result

If you take an example of say 5, all your if(nextInvNum tests are true and each one does its assignment with the last one (that only adds a single '0') winning. One way to fix this is: if(nextInvNum …
Keith C's user avatar
  • 137k
3 votes
Accepted

Counting query results and displaying them in visualforce

headervalue="Quantity"> </apex:column> </apex:pageblocktable> </apex:pageblock> </apex:page> The error you were seeing was that you had not provided the alias name "quantity" in the aggregate
Keith C's user avatar
  • 137k
1 vote
Accepted

Apex AggregateResult from 2 Objects

If you mean you want to append the second set of records then this should do it: public List<CoverageTeamMember> getCoverageTeam() { Account a = getAccount(this.controller != null ? this.controll …
Keith C's user avatar
  • 137k
1 vote

Aggregate Values with Limits and Orders

The problem is that multiple rows can be merged to create each AVG so you also need to find a way to combined the CreatedDate values of those multiple rows into a single value. I think the only choice …
Keith C's user avatar
  • 137k
5 votes
Accepted

Display an aggregate result on a visualforce page

The AggregateResult object is like a Map and so to access the values you need to use map syntax in the Visualforce: <apex:column value="{!s['total']}"></apex:column> PS Here is a working example o …
Keith C's user avatar
  • 137k
2 votes

AggregateResult Count help

I don't understand the two parts of your question but the code below hopefully covers at least part of what you are looking for. Because count(fieldName) is available, some simple dynamic SOQL can be …
Keith C's user avatar
  • 137k
0 votes
Accepted

Better SOQL Query or Ability to Parse Results by Field

Your field/object naming is a little puzzling, but this outline illustrates a general approach to the problem where a single aggregate query is done grouped by the set of SKU values with a map used to …
Keith C's user avatar
  • 137k
1 vote
Accepted

Cross-tabular Report based on GROUP BY CUBE Result

Here is some (untested) code for one way to do this. Call this method somewhere in your controller to convert the data. It finds the unique origin and status values and adds up the counts for all the …
Keith C's user avatar
  • 137k
3 votes

How to sort Wrapper class?

To add to dphil's answer, for your class it sounds like you want something like this: public class QLWrap implements Comparable { ... public Integer compareTo(Object o) { QLWrap tha …
Keith C's user avatar
  • 137k
7 votes
Accepted

For loop run just once

The problem is probably that you re-initilaise the Summaries list every time round the loop to an empty list so you end up with only 1 item in the final list. This is probably what you want: Summ …
Keith C's user avatar
  • 137k
0 votes
Accepted

Aggregate List displaying Repeating values

One solution is to modify the logic to also capture Servicer__r.Id in the aggregate queries and to store that in the CoverageTeamMember class (in a field called say servicerId). …
Keith C's user avatar
  • 137k
5 votes

Incompatible types since an instance of List is never an instance of AggregateResult

When you execute a query that includes a GROUP BY term it is always an array (list) of AggregateResult objects that is returned - see Working with SOQL Aggregate Functions. …
Keith C's user avatar
  • 137k
3 votes
Accepted

Group by Rollup: Visualforce Remoting Exception: Too many query rows: 1000001

Surprising. It would be worth looking at the query in the Developer Console Query Plan Tool. (That article includes several links about how Salesforce queries are optimised.) In case it made a differ …
Keith C's user avatar
  • 137k