这是来自this SO question的后续问题。
现在已经从找到here的演示链接库创建了模型结构,我现在想要提取事实表信息。
模型结构是:
us-gaap_IncomeStatementAbstract
Statement [Table] us-gaap_StatementTable
Legal Entity [Axis] dei_LegalEntityAxis
Entity [Domain] dei_EntityDomain
Statement [Line Items] us-gaap_StatementLineItems
Net sales us-gaap_SalesRevenueNet
Cost of sales us-gaap_CostOfGoodsAndServicesSold
Gross margin us-gaap_GrossProfit
Operating expenses: us-gaap_OperatingExpensesAbstract
Research and development us-gaap_ResearchAndDevelopmentExpense
Selling, general and administrative us-gaap_SellingGeneralAndAdministrativeExpense
Total operating expenses us-gaap_OperatingExpenses
Operating income us-gaap_OperatingIncomeLoss
Other income/(expense), net us-gaap_NonoperatingIncomeExpense
Income before provision for income taxes us-gaap_IncomeLossFromContinuingOperationsBeforeIn...
Provision for income taxes us-gaap_IncomeTaxExpenseBenefit
Net income us-gaap_NetIncomeLoss
Earnings per share: us-gaap_EarningsPerShareAbstract
Basic us-gaap_EarningsPerShareBasic
Diluted us-gaap_EarningsPerShareDiluted
Shares used in computing earnings per share: us-gaap_WeightedAverageNumberOfSharesOutstandingAb...
Basic us-gaap_WeightedAverageNumberOfSharesOutstandingBa...
Diluted us-gaap_WeightedAverageNumberOfDilutedSharesOutsta...
Cash dividends declared per share us-gaap_CommonStockDividendsPerShareDeclared
我尝试从xml文档重新创建的Fact Table包含以下信息:
然后可以渲染此事实表以生成此表:
问题在于我不确定如何获取每个订单项的具体事实。例如,模型结构包含具有概念Net sales
的元素us-gaap_SalesRevenueNet
。 instance document包含以下对us-gaap_SalesRevenueNet
的引用:
contextRef decimals fact_value id_x tag unitRef {http://www.w3.org/1999/xlink}arcrole {http://www.w3.org/1999/xlink}href {http://www.w3.org/1999/xlink}type {http://www.w3.org/2001/XMLSchema-instance}nil cik_x cik_y id_y startDate endDate instant
471 eol_PE2035----1510-Q0015_STD_91_20141227_0 -6 74599000000 id_5473321_00DC1C18-22C7-426B-AF70-F6B281547EC4_2_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0 2014-09-28 2014-12-27
527 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1138497 -6 30566000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_1002_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1138497 2014-09-28 2014-12-27
529 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1173722 -6 5448000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_2002_6 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1173722 2014-09-28 2014-12-27
531 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1181338 -6 16144000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_3002_4 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1181338 2014-09-28 2014-12-27
533 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1184739 -6 17214000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_4002_2 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1184739 2014-09-28 2014-12-27
535 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1257623 -6 5227000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_5002_8 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20141227_0_1106947x1257623 2014-09-28 2014-12-27
628 eol_PE2035----1510-Q0015_STD_91_20151226_0 -6 75872000000 id_5473321_00DC1C18-22C7-426B-AF70-F6B281547EC4_1_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0 2015-09-27 2015-12-26
701 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1138497 -6 29325000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_1001_0 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1138497 2015-09-27 2015-12-26
703 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1173722 -6 4794000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_2001_6 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1173722 2015-09-27 2015-12-26
705 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1181338 -6 18373000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_3001_4 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1181338 2015-09-27 2015-12-26
707 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1184739 -6 17932000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_4001_2 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1184739 2015-09-27 2015-12-26
709 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1257623 -6 5448000000 id_5473321_493F2921-7163-4A93-9BC8-89E0F5E62B3B_5001_8 {http://fasb.org/us-gaap/2015-01-31}SalesRevenueNet iso4217_USD 0000320193 0000320193 eol_PE2035----1510-Q0015_STD_91_20151226_0_1106947x1257623 2015-09-27 2015-12-26
在显示的12个事实中,事实表只需要两个 - 它们是contextRef为eol_PE2035----1510-Q0015_STD_91_20141227_0
和eol_PE2035----1510-Q0015_STD_91_20151226_0
的事实。
这些contextRef id对应于实例文档中的以下事实:
<context id="eol_PE2035----1510-Q0015_STD_91_20141227_0">
<entity>
<identifier scheme="http://www.sec.gov/CIK">0000320193</identifier>
</entity>
<period>
<startDate>2014-09-28</startDate>
<endDate>2014-12-27</endDate>
</period>
</context>
<context id="eol_PE2035----1510-Q0015_STD_91_20151226_0">
<entity>
<identifier scheme="http://www.sec.gov/CIK">0000320193</identifier>
</entity>
<period>
<startDate>2015-09-27</startDate>
<endDate>2015-12-26</endDate>
</period>
</context>
这些contextRefs本质上是Period Axis
元素。我不知道如何从xml documents确定周期轴,因此无法重现事实表。任何人都可以解释如何做到这一点?
答案 0 :(得分:1)
您粘贴的是简化渲染,而不是IncomeStatement的完整渲染。
您可以从definition linkbase中获取该信息:
例如,您列出的SalesRevenueNet之一链接到上下文“eol_PE2035 ---- 1510-Q0015_STD_91_20141227_0_1106947x1173722”。此上下文包含对Axis“us-gaap:StatementBusinessSegmentsAxis”的限制。因此,此上下文不在StatementOfIncome中,因为此轴未在相应定义链接库的超立方体中定义。
我认为你是出于学习目的而这样做的?否则,我建议你使用像secxbrl.info这样的服务: