Views: 86
定義
ancestorFilterにxbrli:xbrlを指定し、typedDimensionに文字を含む項目全てを対象にして<gl-cor:amount>にgeneralフィルタのtest=”../gl-cor:debitCreditCode eq 'C'”で貸方額、'D'で借方額のそれぞれの合計金額を集計し、合計金額が一致するか検証する。
試行中のファイルは、GitHubから
<gen:link xlink:type="extended" xlink:role="http://www.xbrl.org/2008/role/link"> <!-- formula --> <formula:formula id="formula_balance" aspectModel="dimensional" implicitFiltering="true" value="if (abs(sum( $creditAmts ) - sum( $debitAmts )) lt 1.0) then concat('Credit Amounts(',sum($creditAmts),') Debit Amounts(',sum($debitAmts),') is in balance') else concat('Credit Amounts(',sum($creditAmts),')Debit Amounts(:',sum($debitAmts),') is not in balance')" source="formula:uncovered" xlink:type="resource" xlink:label="formula_balance"> <formula:aspects> <formula:concept> <formula:qname>gl-cor:entriesComment</formula:qname> </formula:concept> </formula:aspects> </formula:formula> <!-- variableArc --> <variable:variableArc name="debitAmts" order="1.0" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" xlink:from="formula_balance" xlink:to="debitAmount"/> <variable:variableArc name="creditAmts" order="2.0" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" xlink:from="formula_balance" xlink:to="creditAmount"/> <!-- factVariable --> <variable:factVariable id="creditAmount" bindAsSequence="true" xlink:type="resource" xlink:label="creditAmount"/> <variable:factVariable id="debitAmount" bindAsSequence="true" xlink:type="resource" xlink:label="debitAmount"/> <!-- variableFilterArc --> <variable:variableFilterArc order="1.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="creditAmount" xlink:to="amount_nameFilter"/> <variable:variableFilterArc order="2.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="creditAmount" xlink:to="Credit_filter"/> <variable:variableFilterArc order="3.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="creditAmount" xlink:to="typedDimension"/> <variable:variableFilterArc order="4.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="creditAmount" xlink:to="typedDimension1"/> <variable:variableFilterArc order="5.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="creditAmount" xlink:to="ancestorFilter"/> <variable:variableFilterArc order="6.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="debitAmount" xlink:to="amount_nameFilter"/> <variable:variableFilterArc order="7.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="debitAmount" xlink:to="Debit_filter"/> <variable:variableFilterArc order="8.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="debitAmount" xlink:to="typedDimension"/> <variable:variableFilterArc order="9.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="debitAmount" xlink:to="typedDimension1"/> <variable:variableFilterArc order="10.0" complement="false" cover="true" xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="debitAmount" xlink:to="ancestorFilter"/> <!-- filter --> <cf:conceptName id="amount_nameFilter" xlink:type="resource" xlink:label="amount_nameFilter"> <cf:concept> <cf:qname>gl-cor:amount</cf:qname> </cf:concept> </cf:conceptName> <gf:general id="Debit_filter" test="../gl-cor:debitCreditCode eq 'D'" xlink:type="resource" xlink:label="Debit_filter"/> <gf:general id="Credit_filter" test="../gl-cor:debitCreditCode eq 'C'" xlink:type="resource" xlink:label="Credit_filter"/> <tf:ancestorFilter id="ancestorFilter" xlink:type="resource" xlink:label="ancestorFilter"> <tf:ancestor> <tf:qname>xbrli:xbrl</tf:qname> </tf:ancestor> </tf:ancestorFilter> <pf:periodInstant id="periodInstant" date="2020-01-01" xlink:type="resource" xlink:label="periodInstant"/> <df:typedDimension id="typedDimension" test="string-length(gl-cor:EntryNumber) > 0" xlink:type="resource" xlink:label="typedDimension"> <df:dimension> <df:qname>gl-cor:dEntryNumber</df:qname> </df:dimension> </df:typedDimension> <df:typedDimension id="typedDimension1" test="string-length(gl-cor:LineNumber) > 0" xlink:type="resource" xlink:label="typedDimension1"> <df:dimension> <df:qname>gl-cor:dLineNumber</df:qname> </df:dimension> </df:typedDimension> </gen:link>
実行結果
世界標準データ形式の実装検証
1 XBRL 2.1タクソノミ
UN/CEFACTコア構成要素技術仕様(CCTS)
目的:CCTS構造をXBRL 2.1で表現することで透明性と拡張性を高める
タプルの子項目に子タプルを含まない形とする
DTS
タプル定義
定義リンクベース
表示リンクベース
2 XBRL 2.1インスタンス文書
Typed dimensionを用いて定義リンクベース(requires-element)の関係を組み込む
タクソノミ文書でのxbrldt:dimensionItem定義
インスタンス文書でのxbrli:context定義
インスタンス文書
フォーミュラリンクベース実行結果
3 XBRL 2.1フォーミュラリンクベース
定義
実行結果
4 XBRL 2.1テーブルリンクベース[試行中]
定義
実行結果
5 XBRL 2.1タプルを使わないとき[試行中]
定義
インスタンス文書
実行結果