Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So there is a 2000 limit of rows per analytic snapshot, and there is an idea to remove that limit.

Until than:

How can I have more than 2000 rows from the Analytic Snapshot entered into Salesforce?

share|improve this question
up vote 4 down vote accepted

I had to build opportunity snapshots for a client whose typical monthly data load was around 6500 records. I created a formula field that took the opportunity number (a serial number) and then divided by 4 and kept the remainder. This resulted in a all the opportunities being marked, 1,2,3 or 4. I then created 4 reports and filtered by that number. This effectively gave me 4 reports that equally divided the entire load of 6500. I mapped each report to my snapshot object and ran them at the same time. I little extra setup but once done it ran just fine.

The formula field will better look like this:

share|improve this answer

In order to get around the limit of 2k for an analytic snapshot and prevent you from having to manually touch the data each day, week, month that you want your snapshot for, I would suggest using a Scheduled Batch Class. You would need to create your own custom object to hold your 'Raw Data', that is timestamped. You then use your Scheduled Batch Class to populate your new snapshot object with the data at your desired interval.

Example Scheduled Class

global class ScheduledBatchJob implements Schedulable{

    public static String schedule = '0 00 00 * * ?';  //Every Day at Midnight 

    global static String scheduleThisJob() {
        ScheduledBatchJob SBJ = new ScheduledBatchJob(); 
        return System.schedule('Your Job Name', schedule, SBJ);

    global void execute(SchedulableContext sc) {

        MyBatchJob Batch = new MyBatchJob();
        ID batchprocessid = Database.executeBatch(Batch,100);           

Example Batch Job (this will gather the "raw data" as you call it)

global class MyBatchJob implements Database.Batchable<sObject>{

    global final string query;

        //Example query, obviously Im sure you might even use another object
    global MyBatchJob(){
        query = 'Select Id, Name From Contact Where MailingState = \'MA\'';     

    global Database.QueryLocator start(Database.BatchableContext BC){
        return Database.getQueryLocator(query);

    global void execute(Database.BatchableContext BC,List<sObject> scope) {
        List<Snapshot_Custom_Object__c> objs = new List< Snapshot_Custom_Object__c >();

        //Assuming the snapshots you want are of Contact data
        for(Sobject s : scope){
            Contact c = (Contact) s;
            objs.add(new Snapshot_Custom_Object__c(
                 //Populate your Custom Object with data from the Contact
        insert objs; 

   global void finish(Database.BatchableContext BC) {
        System.debug(LoggingLevel.WARN,'Batch Job is Complete!!!!!');


So basically you query all the objects (Using Contacts in the above example), then you use the data from those objects to create your custom object for snapshot data. You insert all the snapshot data, and you now have this data without having to manually touch the data at each desired interval (Day, week, month, etc.)

share|improve this answer
Consider rewording this answer in a way that does not refer to the other answer, since this is a complete answer by itself, but "sounds" like a comment to an answer, instead. Move the relevant parts that refer to the other answer as comments on the other answer. – sfdcfox Dec 26 '13 at 14:24
I'll have to check that. Even that for now, my entire snapshot will consist of running it once, on 1/1/2014 morning :-) – Saariko Dec 26 '13 at 14:35
@sfdcfox, good point. I have updated the answer to not reference the other answer directly, and added comment to the other answer with my comments. – Chris Duncombe Dec 26 '13 at 14:56

Create the full report you want to have the analysis data for, and save it in tabular format (raw-data as I like to call it)

Export it to CSV file, and save locally.

Create a custom object, with ALL the fields in your report.

Using Data-Loader upload the records from the report into SF.

Now, you have a snapshot (remember to add a runtime or other date/time to the object) and you can work on it and report on it as you wish.

share|improve this answer
Although this will definitly work, I would suggest using something a bit less manual. I have added another answer to that effect. – Chris Duncombe Dec 26 '13 at 14:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.