Numbers not parsing correctly?

Aug 29, 2012 at 5:18 AM

Thanks for sharing the library Jeff!!!!

Newbie and trying to parse a sample. The numbers don't seem to match what the financial statements and xml generates. Any ideas?

E.g Using your blog sample, added these output lines:

WriteFactValue(currentFragment, "CashAndCashEquivalentsAtCarryingValue");                    

And get the wrong numbers for every item??

gepsioconsole msft-20120630.xmlNumber of facts...: 2040Number of units...: 8Number of contexts: 695EntityRegistrantName: MICROSOFT CORPDocumentPeriodEndDate: 2012-06-30CashAndCashEquivalentsAtCarryingValue: 6076000000

The xbrl has:
<us-gaap:CashAndCashEquivalentsAtCarryingValue contextRef="eol_PE8528----1210-K0017_STD_0_20120630_0" decimals="-6" id="id_59870_FAE4F631-B9DE-4177-B482-2D6236CE52FA_1_2" unitRef="iso4217_USD">6938000000</us-gaap:CashAndCashEquivalentsAtCarryingValue> 

For comparison, MSN Money and Yahoo Finance match what the XBRL shows, so it seems like Gepsio is printing the value incorrectly??

http://www.microsoft.com/investor/SEC/default.aspx
http://investing.money.msn.com/investments/stock-balance-sheet/?symbol=us%3AMSFT&stmtView=Ann
http://finance.yahoo.com/q/bs?s=MSFT+Balance+Sheet&annual 

 

Coordinator
Aug 29, 2012 at 12:53 PM

I'm not sure, but I would be happy to take a look at it for you. I would very much appreciate it if you could send along a ZIP file so I can look at this for you. Please include the following in the ZIP file:

  • the XBRL document instance you're reading in with Gepsio
  • any supporting linkbase and schema documents
  • the code you are using to print the values (I am assuming that you're using Powershell, but I could be wrong ... just attach any source code that you're using to get the values printed)

Thanks for using Gepsio,

Jeff

Coordinator
Aug 29, 2012 at 12:57 PM

I think I was confused by your closing statement of "it seems like Gepsio is printing the value incorrectly" as Gepsio doesn't print anything. It simply provides values that applications can print. I am hoping you can clear up my misunderstanding. :)

Aug 29, 2012 at 11:00 PM

Thanks Jeff for the quick reply.

Yes, Gepsio doesn't print anything by itself, but I am printing the values gepsio provides using the GepsioConsole test demo.

Filed linked below, but let me know if you need the zip.

  • the XBRL document instance you're reading in with Gepsio
  • recent 10-K linked off the above page - http://apps.shareholder.com/sec/XBRLNav.aspx?companyid=MSFT&docid=8733512
  • any supporting linkbase and schema documents
  • see link above
  • the code you are using to print the values (I am assuming that you're using Powershell, but I could be wrong ... just attach any source code that you're using to get the values printed)
  • Started with your GepsioConole blog post/sample - http://gepsio.blogspot.com/2012/03/using-gepsio-from-c.html
  • Goto line 50 of GepsioConsole.cs and add WriteFactValue(currentFragment, "CashAndCashEquivalentsAtCarryingValue");         
Aug 30, 2012 at 12:16 AM

It's probably a newbie question. :)

There are multiple (10) "CashAndCashEquivalentsAtCarryingValue" values with different numbers. 1 of which is the correct one for this 10k. I am not sure what the other entries are for, but it probably comes down to I don't know much about XBRL itself at this point.

Coordinator
Aug 30, 2012 at 12:20 AM

Don't beat yourself up. You may have found a bug. If you haven't found a bug, then you have found something that is poorly documented and needs more explanation. Either way, the ball is in my court, not yours.

Thanks for the links. I will write up a sample and see what comes out for me. I'll come back to you with a followup (most likely in a blog post explaining the situation). I will post a link to any writeup that I do here on this thread and also to the Gepsio Facebook page at http://www.facebook.com/gepsio. Turn notifications on for this thread so you are notified when I post a followup or have additional questions for you.

Thanks for using Gepsio!

Aug 30, 2012 at 1:39 AM

Thanks Jeff! I think I got this to work, but don't know if this is the "best" and most optimum way.

Comments?

Basically had to:

1. Find the document period and save the date
2. Go through the facts and filter facts based on name and date

 

 

                foreach (var currentFragment in xbrlDoc.XbrlFragments)
                {
                    WriteFactValue(currentFragment, "EntityRegistrantName");
                    WriteFactValue(currentFragment, "DocumentPeriodEndDate");
                    DisplayFragmentStatistics(currentFragment);

                    //Find document period
                    System.DateTime currentPeriod = new System.DateTime();
                    foreach (var currentFact in currentFragment.Facts)
                    {
                        if (currentFact.Name.Equals("DocumentPeriodEndDate") == true)
                        {
                            var currentFactAsItem = currentFact as Item;
                            currentPeriod = System.DateTime.Parse(currentFactAsItem.Value);
                            break;
                        }
                    }

                    Console.WriteLine("Dumping facts for period Date: {0:d}", currentPeriod);


                    WriteFactValue(currentFragment, "CashAndCashEquivalentsAtCarryingValue", currentPeriod);

                    
                }
With a new WriteFactValue overload with a new date filter:

        private static void WriteFactValue(XbrlFragment currentFragment, string factName, System.DateTime dt)
        {
            foreach (var currentFact in currentFragment.Facts)
            {
                if (currentFact.Name.Equals(factName) == true)
                {
                    var currentFactAsItem = currentFact as Item;

                    //Print only if the context date matches
                    if (currentFactAsItem.ContextRef.InstantDate.Equals(dt))
                    {
                        Console.WriteLine("{0}: {1}", factName, currentFactAsItem.Value);
                        return;
                    }
                }
            }
        }

 

Coordinator
Aug 30, 2012 at 1:16 PM

Thank you for the additional code! I will be taking a look at all of this this weekend and will be returning soon with feedback.