Excel: exporting data, FixID, 15 and 18 character IDs, and big numbers
Oct 24, 2007 If you are using Excel to work with salesforce data, you'll know there are three ways:
- salesforce.com connector for Office
- The Excel Add-in
- exporting CSV files from reports
Number one is based on this piece of software you'll find the in the setup section of salesforce:
Number 2 is the free software available from this page: http://blogs.salesforce.com/features/2006/05/excel_connector.html
if you mix number 2 and the other 2, you'll have seen a problem - one has an 18 character ID field - coming from the API. The others have a 15-character ID field, that you'll often see in the UI and in the URL line of salesforce.com
If you use just options 1 and 3, and you are working in Excel, you may have found a more insidious problem. Excel's VLOOKUP() function isn't case sensitive. Or you might have not noticed. That might be worse.
An enhanced version of the Excel Connector is QueryAmp/Pro - from ForceAmp - http://www.salesforce.com/appexchange/detail_overview.jsp?NavCode__c=&id=a0330000002excyAAA
15-character IDs
Salesforce's ID structure is normally (for 15 character IDs):
XXXYYYYYYYYYYYY
where
XXX is the object's identifier
YYYYYYYYYYYY is the ID of the object.
these values are case-sensitive: 00a000000a12345 is not the same thing at all as 00a000000A12345 or worse, 00A000000a12345
In Excel, this character data comes across ok. It will be loaded in as part of a CSV file from a salesforce.com report, or as part of the Office Connector, when it imports a salesforce.com report directly into Excel.
But Vlookup?
Vlookup normally doesn't see case differences. Excel's help will tell you.
So for vlookup, : 00a000000a12345 is the same thing as 00a000000A12345, even though in salesforce.com, it's not. So if you are using it to gather data or join sets of data, it will wrongly join some of the data.
Microsoft has a ready-built solution to help you through these problems. Like a kind of 12-step program for people with distressed, over-sensitive data, it provides a great example of the formula you need to do the case-sensitive lookup:
http://support.microsoft.com/kb/214264
18 character IDs and how to get them
You may just want to get the 18-character IDs, to make your life easier.
To get and 18 character ID from a 15-character one, there's a method described in the salesforce.com help system - "How do I convert an id from 15 to 18 characters?" if you want to search for it. I can't give you a URL because you have to be logged in to see help, and your URL depends on your instance... but you get the idea.
If you are using Excel, and have the Excel Connector described as number 2 above, you'll be able to use a "User-Generated function" to convert to 18 characters.
You may need to use the Excel Connector before the function will become available in Excel.
You can now insert the FixID into a cell and have it translate the 15 character ID from the screen, Office Connector, or CSV file, to an 18-character ID to be used in the API or with the Excel Connector, or a partner product.
Once you have an 18-character ID, you can compare it against the API's 18-character ID, or use VLOOKUP in Excel to gather, group and join the data.
The limits of Excel
Bizarrely, there is a limit to Excel and it's number is also 15. As much as Excel can take text strings of almost any length, it isn't too happy about numbers. Let's suppose you wanted to import this report:
Well, in the exported file, we'd save this data:
But when Excel opened it, you'd see this:
hey! all the hundreds of dollars and less are gone!
It's just like Superman III - if only there was a way of taking that money and putting into my bank account...
But why is this truncated?
Excel is doing what it's designed to do, and in the event of somebody exceeding the IEEE 754 math limits, it makes it 15 digits of precision. It does this when importing.
If you save the CSV file, then open it through the import wizard in Excel
you can tell it that the column contains text. Then nothing will be truncated. But it won't be a number either, so you can't average it or do other things to it, such as sum it. So you can choose. Keep the hundreds and look at them, or actually use the number.
This only happens when you have very large numbers. Numbers smaller than 10,000,000,000,000.00 will come across fine. So don't go worrying that your calculations are all wrong.

Thanks for the useful guidance. I trying to figure out this information in some other sites but was unable to get the perfect one. yours is really a simple an informative information.
Posted by: CCNA Training | May 02, 2009 at 12:16 AM