EnergyCAP provides two methods for importing billing data into the EnergyCAP database using a flat file format.
This topic describes the import process from the EnergyCAP Work Flow Manager. For more detailed information on flat file preparation than is provided in this topic (including acceptable data formats, observation pairings, etc.), see the topic on bill import rules and options.
The actual bill import is part of an import process that may vary from organization to organization, but will generally include all or most of the following steps:
Below, each of these steps are explained in more detail.
REQUIRED file information/formats:
For additional information, see the topic on import rules and options.


After the import, check for problem bills from the batch in the Bill Import Processor Problem folder. 
Bills appearing there should be edited and then re-imported (see next step).



Click here for an example Excel file with some common errors.
Typically, each line in the file will be for an Account-Bill Start Date-Meter group. Sort Order must be:
The Account Code cannot be NULL.
Any other value, or no value, is interpreted as if it were an "A."
| AccountCode | STARTDATE | ENDDATE | ACE | MeterCode |
| 123456-1 | 20071201 | 20071231 | A | !AUTO! |
In the above example, the importer will look for the meter on account 123456-1. If it has JUST ONE METER, then the importer will assign all charges in this row to that meter. If it has more than one meter, then it will not import the row.
| AccountCode | Start Date | End Date | ACE | MeterCode |
| 123456-1 | 20071201 | 20071231 | A | !AUTO!:ELECTRIC |
In the above example, the importer will look for the ELECTRIC meter on account 123456-1. If it has JUST ONE METER, then the importer will assign all charges in this row to that meter. If it has more than one ELECTRIC meter, then it will not import the row.
To view the commodities in EnergyCAP, click Tools > Unit System

The full list of available commodities can be see from the Commodities tab in the Unit System Editor window.
Typically, each line in the file will be for an Account-Bill Start Date-Meter group. Thus, the file should be sorted by ascending Account Code, ascending Vendor Code (if included), ascending Start Date, ascending End Date.
The headers for the first five columns described above (Account code, start date, end date, actual/estimated, meter code) are mandatory columns. Every column after meter code is optional and therefore the column heading is what defines the column contents. These column headings must be in ALL CAPS except for the CAPTION portion.
Example of Bodylines in a Bill
To achieve the above results, the import file should be formatted in the following manner (Note: the first five columns have been removed from this example):
| USE:KWH | USE:USDOLLARS | DEMAND:KW | ONPKDEMAND:KW | ONPKUSE:KWH | OFFPKDEMAND:KW | ONPKDEMAND:KW |
| 10880 | 705.52 | 30 | 0 | 0 | 0 | 0 |
Since each row represents charges for a specific meter on a specific account, there will be occurrences where the row of data will not have values for some columns (ex. You have water and electric on a particular account. The OBSERVATION TYPE:UNIT:CAPTION for water will be different than the electric - and so you need to just put values in the columns corresponding to that row’s meter).
The "OBSERVATION TYPE:UNIT:CAPTION" pair can appear multiple times in each row. It is valid to define multiple Value, Cost, or Value immediately followed by Cost fields in the file header. For example, a file containing data for accounts with Electric Use and Cost, Electric Demand and Cost, and Natural Gas Use and Cost would have a header record of: "USE:KWH", "USE:USDOLLARS", "BILLEDDEMAND:KW", "BILLEDDEMAND:USDOLLARS", "USE:CCF", "USE:USDOLLARS". The body lines for Electric Use/Cost and Demand/Cost are expected to be associated with an electric meter and the body lines for Natural Gas Use/Cost are expected to be associated with a natural gas meter. The Natural Gas Use/Cost fields should not be populated in the electric meter line and vice versa.
To obtain bills with both Value and Cost entries on a single body line, you must enter the value first and immediately follow it with the cost. For example, a body line with usage in KWH and a cost in dollars would need the columns to be defined as "USE:KWH", "USE:USDOLLARS". ! Beginning with Release 6.0, NO NULLS are permitted in any observation type pair (such as USE/USE)! If a NULL is present, the record will not be imported and an error will be generated. !
If two consecutive columns have the same OBSERVATION TYPE, and the second column has a UNIT of cost, a single line item is created on the bill using both the value and the cost. For example, consecutive columns of "USE:KWH", "USE:USDOLLARS" will result in a single line on the bill having KWH and Cost (in US Dollars).
To obtain bills with a Cost Only body line, use one of the NOUN observation types that are associated with MONEY (Charge, SubtotalCost, Tax, etc.). For example, "CHARGE:USDOLLARS".
Example:
In this example, the consecutive columns share the same observation type of USE. Since the first column reflects the UOM of KWH and the second column shows a UOM of USDOLLARS (which is associated with MONEY).
| USE:KWH | USE:USDOLLARS |
| 10880 | 705.52 |
This will produce a single line in the bill view.

To import bills with a Value Only body line, use any of the NOUN observation types that are NOT associated with MONEY. For example, "DEMAND:KW".
This screenshot shows bodylines (underlined in red) which are Value Only.
Normally, the caption (the text label shown on the left side of the bill entry screen for each line item on a bill) is set equal to the observation type display name. You can set your own captions by making a third entry in the heading. Example: "USE:KWH:ON PEAK TIER 1 USAGE" is the column heading to insert the desired bill bodyline heading. The caption cannot have a colon in it. If you choose to use a caption in situations such as USE:KWH and USE:COST, you want to specify a caption JUST FOR THE FIRST ITEM IN THE PAIR, and not the second. So in the example, this is the correct way to modify the caption and still end up with the information being represented in the bill as one line and not two:
Correct: USE:KWH:Electric Usage and USE:USDOLLARS
Incorrect: USE:KWH:Electric Usage and USE:USDOLLARS:Electric Usage
The "PAYAMOUNT:USDOLLARS" column specifies the pay amount for the bill. In earlier versions of EnerygCAP, if this column was not included in the import file, the bill pay amount would be the sum of all costs of all bodylines on the bill subject to the rules indicated in the Unit System for each observation type specified. If PayAmount is included, but the sum of the charges on the bill calculated to a different total, the bill was saved but with a + or - balance. This was not good. Therefore, beginning with Release 6.0, the PayAmount column is simply ignored by the Importer. This assures that all imported bills will balance.
IMPORTANT: It is HIGHLY recommended to add an additional column called ‘*EndOfRecord’, that will be ignored in the import, so that the last column of every row in the import file has a value in it. The value for that column can be anything, but is generally set to the letter ‘X’. Again, this data is NOT imported to EC, but is used to indicate to the import utility that there are no further values to be processed in the current row and to proceed with the next row in the import file. Every row in the import file should have a value of ‘X’ in this column.
Example Header:
ACCOUNT, STARTDATE, ENDDATE, ACE, METER, USE:KWH, USE:COST, *END_OF_RECORD_MARKER
The * in the column header ‘*END_OF_RECORD_MARKER’ tells the importer to ignore the contents of this column. It is then recommended to give every row in the import file a value of ‘X’ for this column. In that way each row is terminated and will be ensured to process correctly.
WHEN IN DOUBT, be CONSERVATIVE and EXPLICIT and test a sample of the file format with a small number of records.
Any column that has a header which begins with an * will be ignored. This allows you to minimize the reformatting of non-comforming spreadsheets by simply ignoring non-conforming columns. See Pay Amount section for another suggestion of how this can be used.
This is a list of optional fields which can be used in the bill import process. These fields can provide additional information for a bill that may be useful or necessary information for specific data needs.
In the event that a file aborts partially through processing, the bills which have been successfully entered will remain in EnergyCAP Enterprise. As long as the file does not contain Corrected "C" records, it can be corrected and processed again. If the file does contain Corrected "C" records and it is processed again, additional bills for the "C" records will be created and manual steps will need to be taken to remove/prevent duplicate bills from causing difficulties. As an alternative to this, rows that generated errors can be re-imported through the Bill Reimport Processor which is available from within Workflow Manager.
Example: The problems listed in the Bill Import Processor folder are eligible for re-import by using the Bill Reimport Processor. Unless the issues indicated in the Message column are addressed, the bills will not import successfully.

To run the Bill Reimport Processor, navigate to the Account Manager in EnergyCAP (Accounting/Accounts)and click Tools/Processor/Bill Reimport.

The Bill Reimport window will open. Click the Start button to initiate the Reimport. When done click Close.
After bills are imported into EnergyCAP, they are given a status of Unverified. In order for a bill to be eligible for export, it must have a status of Verified. To verify bills you have imported, go to Work Flow Manager and verify bills contained in the Waiting to Verify folder.
The import results are reported in an on-screen log. You can save or print this log in order to maintain a record. Additionally, any issues logged will be viewable from within Work Flow Manager in the Bill Import Problem folder.
Bill Import external to EnergyCAP using the imptsk.exe program
It is also possible to import bills from the command line. See also the topic on External Tasks. Here is an example and explanation of each element:
The usage is:
imptsk -d [dsn] -u [user] -p [pwd] -c [converter] -f [path] -x -a [path] -l [path] -s [section] -v [verbose messages] -remote -t [traceID]
Where:
Usage Example:
"c:\Program Files\EnergyCAP Enterprise\imptsk.exe" -d retailer -u kvs -p kvs -c STANDARD:HISTORICAL_BILL_IMPORT -f "c:\b-test\*.csv" -l "log.txt"
The Bill Import Processor in EnergyCAP contains intelligence logic that enables processing of multiple records in a single bill. However, when there are import problems, EnergyCAP stores the problem records independently of one another in the Bill Import Processor Problem folder. This can cause problems with some accounting system workflows when the problem records are RE-IMPORTED because the Re-import Processor has no built-in logic to distinguish which of the independent records should be included in the re-imported bill. That is, what was one bill in the original import can become two or more bills in the re-import process. Future releases of EnergyCAP will enhance the logic of the Import Processor and the Re-import Processor. For the time being, the following work-around is recommended:
The example below presents two kickouts, each with a header row and a data row:

To join the records, copy the data row from Kickout #2 to the data row of the ‘master’ kickout record for the multi-record bill. Then delete Kickout #2. Repeat the process for any additional kickout records bearing the same account number and start/end dates. In the examples below, the data was corrected in the kickout record (in this case, the account code ‘test2’ was changed to ‘test1’ which is an existing account):

After correcting the kickout records, re-import bills using the Re-Import Processor:

