日期:2014-05-18 浏览次数:20465 次
看看这个小例子: 1、统计昨日的销售额 WITH MEMBER mydate as now() SELECT {[Measures].[销售额]} on COLUMNS, {StrToMember("[时间维].[日].&[" + Format(DateAdd('d',-1,CDate(mydate)), "yyyy年MM月dd日") + "]")} on ROWS from [产品销售专题] 也可以写成: WITH MEMBER mydate as now()-1 SELECT {[Measures].[销售额]} on COLUMNS, {StrToMember("[时间维].[日].&[" + Format(mydate, "yyyy年MM月dd日") + "]")} on ROWS from [产品销售专题] 2、统计最近三个月的销售额(这个也可以用mdx的函数实现) WITH MEMBER mydate as now() SELECT {[Measures].[销售额]} on COLUMNS, {StrToMember("[时间维].[月].&[" + Format(DateAdd('m',-2,CDate(mydate)), "yyyy年MM月") + "]"):StrToMember("[时间维].[月].&["+ Format(mydate, "yyyy年MM月") +"]")} on ROWS from [产品销售专题]
------解决方案--------------------
http://www.cnblogs.com/Ammy/archive/2010/04/06/1705120.html
http://www.cnblogs.com/guanjie20/archive/2010/07/07/1772914.html
------解决方案--------------------
SELECT ( STRTOMEMBER([成品分析].["+@From实际出室时间年月日 + "]") : STRTOMEMBER([成品分析].["+@To实际出室时间年月日] + "]") ON COLUMNS FROM [成品分析]) ,
------解决方案--------------------
我要分呀 哈哈哈 我要疯压弯
------解决方案--------------------
不懂,帮顶,学习,蹭分.
------解决方案--------------------
两个成员之间的集
{member:member}
------解决方案--------------------
请参考STRTOSET(@[date年季度月份], CONSTRAINED)