Hyperion Planning システムからすべての Web フォームをエクスポートし、各 Web フォームの主要な詳細を一覧表示するデータベースを構築しようとしています。Web フォームは XML にエクスポートされ、次のようになります。
<?xml version="1.0" encoding="UTF-8" ?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="6.4 AC Planning" dir="Forms/PnL Inputs" enableOffline="false" planType="2" hide="false" enableCubeView="false" readOnly="false" >
<instruction>Use this form to view detailed account information, and input base level adjustments.</instruction>
<query>
<columns width="100" >
<segment>
<dimension displayName="true" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="Period" hide="false" expand="true" >
<function include="true" name="Descendants" >
<member name="YearTotal" />
</function>
</dimension>
</segment>
</columns>
<rows height="22" >
<segment readOnly="true" >
<dimension displayName="false" displayAlias="true" displayMemberFormula="false" displayConsolidationOperators="false" name="Account" hide="false" expand="true" >
<member name="Advertising - % of Net Revenue SP" />
</dimension>
</segment>
<segment showSeparator="true" >
<dimension displayName="false" displayAlias="true" displayMemberFormula="false" displayConsolidationOperators="false" name="Account" hide="false" expand="true" >
<member name="PL214040" />
<member name="PL214096" />
<member name="PL214011_01" />
<member name="PL214011_03" />
<member name="PL214011_02" />
</dimension>
</segment>
<segment>
<dimension displayName="false" displayAlias="true" displayMemberFormula="false" displayConsolidationOperators="false" name="Account" hide="false" expand="true" >
<member name="PL214021_01" />
<member name="PL214021_03" />
<member name="PL214021_02" />
<member name="PL214020" />
</dimension>
</segment>
</rows>
<pages>
<segment>
<dimension displayName="false" displayAlias="true" displayMemberFormula="false" displayConsolidationOperators="false" name="Entity" hide="false" >
<function include="true" name="Descendants" >
<member name="&Root_Entity" />
</function>
</dimension>
<dimension displayName="false" displayAlias="true" displayMemberFormula="false" displayConsolidationOperators="false" name="Product" hide="false" >
<function include="true" name="Descendants" >
<member name="&Root_Product" />
</function>
</dimension>
<dimension displayName="false" displayAlias="true" displayMemberFormula="false" displayConsolidationOperators="false" name="Channel" hide="false" >
<member name="CH02" />
<member name="CH03" />
</dimension>
<dimension displayName="false" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="Scenario" hide="false" >
<function name="Descendants" >
<member name="Planning Scenarios" />
</function>
</dimension>
<dimension displayName="false" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="Version" hide="false" >
<function name="Descendants" >
<member name="Planning Versions" />
</function>
</dimension>
<dimension displayName="false" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="Year" hide="false" >
<member name="&CurrFormYear1" />
<member name="&CurrFormYear2" />
</dimension>
<dimension displayName="false" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="Currency" hide="false" >
<member name="LCL" />
<member name="LCL (000s)" />
</dimension>
</segment>
</pages>
<pov>
<dimension displayName="false" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="EVA" hide="false" >
<member name="No_EVA" visible="true" />
</dimension>
<dimension displayName="false" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="ICP" hide="false" >
<member name="ZERO_ICP" visible="true" />
</dimension>
<dimension displayName="false" displayAlias="false" displayMemberFormula="false" displayConsolidationOperators="false" name="RptLevel" hide="false" >
<member name="RL0045" visible="true" />
</dimension>
</pov>
</query>
<businessRules>
<businessRule calcType="0" name="AandC_Base" planType="2" runOnSave="true" hidePrompt="true" useMRU="true" />
</businessRules>
<displayOptions>
<precision useCurrencyPrecision="false" nonCurrencyMax="0" nonCurrencyMin="0" currencyMax="2" percentageMax="2" currencyMin="0" percentageMin="0" />
<display poundMissing="true" enableAttributeDisplay="false" enableCellAttach="true" enableAdHoc="false" multiCurrency="false" enableMassAllocation="false" accountAnnotation="false" enableGridSpread="true" />
<printOptions>
<pageSettings pageSize="A4" orientation="0" font="" fontSize="8" rowHeaderPercentage="35" numDataCols="10" />
<format supportingDetails="false" applyPrecision="false" repeatHeaders="true" formatData="true" />
<printDisplay currency="true" shading="true" cellNotes="false" attribute="true" accountAnnotation="true" />
</printOptions>
<smartViewOptions enableForSmartSlice="false" enableOfflineUsage="false" />
</displayOptions>
<dataValidationRules>
<dataValidationRulesOptions>
<RunValidationsAsLoggedInUser>false</RunValidationsAsLoggedInUser>
<ValidateOnlyForPagesWithBlocks>false</ValidateOnlyForPagesWithBlocks>
<ValidateOnlyForUsersWithAccessToForm>false</ValidateOnlyForUsersWithAccessToForm>
</dataValidationRulesOptions>
</dataValidationRules>
</form>
だから私は、次のようなものから構築しようとしています:
Dimension | Location | Display name | Display alias | Members
______________________________________________________________________
Account | Row | False | True | PL214040; PL214096; PL214011_01; etc
Period | Column | True | False | Descendants(YearTotal)
私は vbscript を使用しており、正規表現検索で解決しようとしましたが、ほとんどの詳細では問題なく機能していましたが、メンバー リストです。
そこで XMLDOM に切り替えましたが、うまくいきません。こちらでいろいろ調べて、いい資料をたくさん見つけたのですが、上記を引き出すには採用できませんでした。
一部のフォームは列にアカウントを持ち、一部は pov などにあることに注意してください。可能な次元のリストがあるので、何を探すべきかはわかっていますが、それ以外はすべて XML ごとに異なります。
どんな助けでも大歓迎です!
少し後: いくつかのコメント (ありがとう!) に基づいて、XMLDOM をいじくり回して、最終的に目的の最終結果の最初の 3 列を取得することができました。各次元に含まれるメンバー。
以下はコードです。これが私のクエリをさらに明確にし、メンバーを収集する方法と各ディメンションの関数を使用する場所を誰かが助けることができることを願っています。
Set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("c:\Users\maxlamer\Documents\6.4 AC Planning.xml")
arrMyDimensions=Array("Account","Period","Currency/Value","Year","Entity","Scenario","ICP","Channel","Version","RptLevel","EVA","Product")
Set nodes = xmlDoc.selectNodes("//*")
For i = 0 to nodes.length - 1
bolFoundOne = False
m=0
For n=LBound(arrMyDimensions) to UBound(arrMyDimensions)
If nodes(i).getAttribute("name")=arrMyDimensions(n) Then
bolFoundOne = True
m=n
End if
Next
If bolFoundOne Then
If nodes(i).parentNode.nodeName="pov" Then
WScript.Echo arrMyDimensions(m) & " is in:" & nodes(i).parentNode.nodeName
Else
WScript.Echo arrMyDimensions(m) & " is in:" & nodes(i).parentNode.parentNode.nodeName
End if
Set pn_attribs = nodes(i).attributes
strMyTempString = arrMyDimensions(m) & " attributes :"
For Each pnAttr in pn_attribs
strMyTempString = strMyTempString & pnAttr.name & " = " & pnAttr.value & vbTab
Next
WScript.Echo strMyTempString & vbCrlf
arrMyDimensions(m)="XX_Located_XX"
End if
Next
上記はかなり粗雑であり、出力を適切にフォーマットするために適切なラッパーを作成する必要があることはわかっていますが、私が何を推進しているのかについての良いアイデアを与えるはずです. 今、最後の列が必要です。