财务审计商业智能分析

运筹规划

博客园 首页 新随笔 联系 管理
iif([时间].currentmember.level.ordinal = 0,
tail((FILTER([时间].currentmember.firstchild.firstchild.firstchild.firstchild : [时间].currentmember.lastchild.lastchild.lastchild.lastchild,NOT ISEMPTY([Measures].[结存数量]))*{[Measures].[结存数量]}),1).Item(0),
iif([时间].currentmember.level.ordinal = 1,
tail((FILTER([时间].currentmember.firstchild.firstchild.firstchild : [时间].currentmember.lastchild.lastchild.lastchild,NOT ISEMPTY([Measures].[结存数量]))*{[Measures].[结存数量]}),1).Item(0),
iif([时间].currentmember.level.ordinal = 2,
tail((FILTER([时间].currentmember.firstchild.firstchild : [时间].currentmember.lastchild.lastchild,NOT ISEMPTY([Measures].[结存数量]))*{[Measures].[结存数量]}),1).Item(0),
iif([时间].currentmember.level.ordinal = 3,
tail((FILTER([时间].currentmember.firstchild : [时间].currentmember.lastchild,NOT ISEMPTY([Measures].[结存数量]))*{[Measures].[结存数量]}),1).Item(0),
([时间].currentmember,[Measures].[结存数量])
))))

下列语句执行效率更佳

iif([日期].currentmember.level.ordinal = 0,
tail((NonEmptyCrossjoin(( [日期].currentmember.firstchild.firstchild.firstchild.firstchild : [日期].currentmember.lastchild.lastchild.lastchild.lastchild),{([Measures].[结存数量])},1)),1).Item(0),
iif([日期].currentmember.level.ordinal = 1,
tail((NonEmptyCrossjoin(( [日期].currentmember.firstchild.firstchild.firstchild : [日期].currentmember.lastchild.lastchild.lastchild),{([Measures].[结存数量])},1)),1).Item(0),
iif([日期].currentmember.level.ordinal = 2,
tail((NonEmptyCrossjoin(([日期].currentmember.firstchild.firstchild : [日期].currentmember.lastchild.lastchild),{([Measures].[结存数量])},1)),1).Item(0),
iif([日期].currentmember.level.ordinal = 3,
tail((NonEmptyCrossjoin(([日期].currentmember.firstchild : [日期].currentmember.lastchild),{([Measures].[结存数量])},1)),1).Item(0),
([日期].currentmember,[Measures].[结存数量])
))))
posted on 2006-07-24 01:02  春申  阅读(830)  评论(0编辑  收藏  举报