Notes and Tips
- This tutorial is presented for educational purposes only
- Always test your rules before running them in a production environment
- Understand your Salesforce environment before performing any operations which may affect your data
- BEST PRACTICE: If you are simulating this tutorial you should load from either a Custom Object, or from the MDA.
- CAUTION: Be careful not to overwrite pre-existing data. If your source data is securely stored in a Custom Object or the MDA data should be safe.
Step 1 - Gaps Found in Data
The above image shows data for which there are obvious gaps. Gaps are caused by missing data (NULLs).
Step 2 - The "All Zeros Rule"
To avoid gaps in data upon load, Best Practice is to load zero values to the date range of interest.
Step 2a - Create New Rule
Create a New Rule with the following parameters:
- Rule Type: Custom
- Rule Name: Admin: Weekly Usage Data Zero
- Description: Load zero values at the beginning of the week for the date range of interest
- Show: Account::Id, Account::Account Name, Account::Customer Info, Account::Customer Info Name
- Account::Customer Info / not equal to / Check (NULL)
- Account::Account Name / equals / Wallys World
NOTE: This tutorial is restricted to the Account "Wallys World" to avoid zeroing other data.
Step 2b - Create Load to Usage Action
Create a new Load to Usage Action with mappings similar to the above image.
Important step is to set desired fields to zero. In the above Page Views and Total Logins are added as Custom Fields and set to zero.
Step 2c - Schedule the Initial Load Zeros Rule
To perform an initial "all zeroes" load, you'll need to schedule the rule as follows:
- This will run on a Weekly basis
- Schedule for start of the week (typically Sunday). Refer to your usage configuration to confirm.
- For the first load, choose a data range
- Start time should be the very start of the day (00 Hrs / 05 Mins)
- Check "Run for historical periods"
- Click "Start" to initiate
Step 2d - First Run (for Historical Periods)
As "Run for historical periods" was selected, a confirmation screen is displayed.
NOTE: This immediately executes the rule.
Step 2e - Edit/Confirm Schedule
When the rule has executed, confirm dates going forward. The End Date is not required.
- As this has been scheduled to run for historical periods, the "Run for historical periods" checkbox is unchecked to avoid overwriting data.
- Going forward, this rule will run each week and place zero values for fields defined within the rule.
Step 2f - Values at Zero
Once the rule has executed, data will now be zeroed for each value specified.
Step 3 - Reload Data
Once all zero values have been loaded to appropriate accounts, reload data from the source.
Again, this may be either a Custom Object or the MDA.
Step 4 - Confirm
After executing the rule, data now is contiguous. No gaps in data are present for the desired period.
As mentioned above, if the Load Zero Values rule is scheduled to execute as the first step each week zero values will always be loaded, then overwritten with actual values. In the case there are no values for a week all data will be set to zero; no gaps or NULL values will be apparent.