使用 icCube 5.1.2,动态集和成员的定义方式与高级/脚本部分中的静态集相同。在 MDX IDE 中计算的结果是不同的。这怎么可能?
-- Advanced / Scripts
-- CREATE STATIC SET [SET MTD] as Mtd( ClosingPeriod([temps].[temps].[jour]) )
-- CREATE STATIC SET [SET MTDLY] as Mtd( ParallelPeriod( [temps].[temps].[annee], 1, ClosingPeriod([temps].[temps].[jour]) ) )
-- CREATE CATEGORY MEMBER [Util].[Categories].[default].[MTD] as [SET MTD]
-- CREATE CATEGORY MEMBER [Util].[Categories].[default].[MTDLY] as [SET MTDLY]
with
-- from static sets
member [Measures].[CM (STATIC SET)] as Sum( [Util].[Categories].[default].[MTD], [Measures].[ventes] ) * 0.001, format_string="#.#"
member [Measures].[CM LY (STATIC SET)] as Sum( [Util].[Categories].[default].[MTDLY], [Measures].[ventes] ) * 0.001, format_string="#.#"
-- dynamic members
member [Measures].[CM (DYNAMIC MEMBER)] as Sum( Mtd( ClosingPeriod([temps].[temps].[jour]) ), [Measures].[ventes] ) * 0.001, format_string="#.#"
member [Measures].[CM LY (DYNAMIC MEMBER)] as Sum( Mtd( ParallelPeriod( [temps].[temps].[annee], 1, ClosingPeriod([temps].[temps].[jour]) ) ), [Measures].[ventes] ) * 0.001, format_string="#.#"
-- dynamic sets
set [SET MTD 2] as Mtd( ClosingPeriod([temps].[temps].[jour]) )
set [SET MTDLY 2] as Mtd( ParallelPeriod( [temps].[temps].[annee], 1, ClosingPeriod([temps].[temps].[jour]) ) )
member [Measures].[CM (DYNAMIC SET)] as Sum( [SET MTD 2], [Measures].[ventes] ) * 0.001, format_string="#.#"
member [Measures].[CM LY (DYNAMIC SET)] as Sum( [SET MTDLY 2], [Measures].[ventes] ) * 0.001, format_string="#.#"
select
{
[Measures].[CM (DYNAMIC MEMBER)],
[Measures].[CM (DYNAMIC SET)],
[Measures].[CM (STATIC SET)],
[Measures].[CM LY (DYNAMIC MEMBER)],
[Measures].[CM LY (DYNAMIC SET)],
[Measures].[CM LY (STATIC SET)]
}
on columns
from [Ventes]
Results:
-- current month this year
CM (DYNAMIC MEMBER): 42698.7
CM (DYNAMIC SET): 42698.7
CM (STATIC SET): 42697.1
-- current month last year
CM LY (DYNAMIC MEMBER): 44243.4
CM LY (DYNAMIC SET): 44243.4
CM LY (STATIC SET): 44242.1