[英]how to use formula in Pentaho Mondrian schema XML
我正在研究ReportServer中的Saiku報告。 我添加了一個Mondrian數據源。 現在我想在報告中添加兩行以顯示第三行中的Sum,我做了一些研發,發現我們可以使用Cell格式化程序,可以使用Formula來使用Schema XML中的列。 但我無法得到確切的消息來源。 以下是我從Mondrian文檔中找到的來源:
<CalculatedMember name="name" dimension="dimension">
<Formula>
[Measures].[Unit Sales] * 2
</Formula>
<CellFormatter>
<Script language="JavaScript">
var s = value.toString();
while (s.length() < 20) {
s = "0" + s;
}
return s;
</Script>
</CellFormatter>
</Measure>
但這似乎是不正確的,這個塊我想要使用公式標簽和使用[Measures].[Unit Sales] * 2
看起來對我有幫助。
任何人都可以幫我糾正這個標簽。
這是我找到的問題的解決方案。
<CalculatedMember name="Profit" dimension="Measures" formula="[Measures].[Store Sales] - [Measures].[Store Cost]">
<CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
</CalculatedMember>
希望這會對其他人有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.