SSAS计算成员求救,求时间段内非重复值的问题

LearyCJY 2012-11-23 11:33:07
SSAS的计算成员中:
SUM(
(
ParallelPeriod(
[时间维度].[时间层次].[月],
1,
[时间维度].[时间层次].CurrentMember
) : [时间维度].[时间层次].CurrentMember)
,[Measures].[成交客户数]
)
这样俺系可以算出一段时间内的客户累计的,但是不对啊,要一段时间内的非重复的客户,
我这里拉了一个,[Measures].[客户编码]的无聚合的度量。
期间段内的非重复客户要怎么写呢?-。-
...全文
426 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
christyxia 2013-05-20
  • 打赏
  • 举报
回复
Urgent hiring--Investment bank hiring -- Senior BI Developer – China – Shanghai Top tire investment bank Basic in Shanghai Attractive package Found in 19th this multinational group is involved in diversified industries, such as oil and gas, construction and chemicals , but internationally the group is known as a financial services, financial management consultancy group.They provides a vast array of advisory and capital-raising solutions to corporations, financial institutions, governments and public-sector organizations around the world. As Europe debt crises they decide to forces in Asia clients accessing deep pools of liquidity and dynamic growth market. Hence a senior BI developer vacancy has arisen. This is a rare opportunity to be part of a legend. You will be involved in Develop Fixed Income Global Reporting Repository and Data Aggregation and Reporting applications project. These projects are global projects that being used by risk managers, senior management desk heads and support-groups on managing firm wide risk for Fixed Income department. This role need you have strong BI and DB skills including UDB&DB2, Microsoft Analysis Service, OLAP and SQL Server knowledge. As a developer you also need to have solid coding experience using SQL & MDX scripts and Cube tuning. As a Senior Business intelligence you are require to have good communication and coordinate skills both in English and Chinese feel comfortable work with senior management on global scale. Plus if you have Java J2EE and C# .NET experience with investment banking background understand fixed income products familiar with GUI and web application will make you a perfect suite for this Senior BI Developer. Sounds a little bit challenge but also very interest? Do not hesitate pick up the phone reach Christy Xia via +86 23229707 or send an email now to Christy.xia@hays.cn For more job opportunities in the market, please refer to our website www.hays.cn/en for details.
  • 打赏
  • 举报
回复
--MDX 写法如下
WITH MEMBER [Measures].[CustomerNum] as
Exists([Customer].[Customer].[Customer].members,
[Date].[Calendar Year].currentmember ,"Internet Orders"
).count

select [Measures].[CustomerNum] on 0 ,
[Date].[Calendar Year].members on 1
from [Adventure Works]
--你可以将 上面的计算列嵌入到你cube 中 然后查询时候直接调用就可以了
Create MEMBER [Measures].[CustomerNum] as
Exists([Customer].[Customer].[Customer].members,
[Date].[Calendar Year].currentmember ,"Internet Orders"
).count

  • 打赏
  • 举报
回复

--MDX 写法如下
WITH MEMBER [Measures].[CustomerNum] as
Exists([Customer].[Customer].[Customer].members,
[Date].[Calendar Year].currentmember ,"Internet Orders"
).count

select [Measures].[CustomerNum] on 0 ,
[Date].[Calendar Year].members on 1
from [Adventure Works]
--你可以将 上面的计算列嵌入到你cube 中 然后查询时候直接调用就可以了
Create MEMBER [Measures].[CustomerNum] as
Exists([Customer].[Customer].[Customer].members,
[Date].[Calendar Year].currentmember ,"Internet Orders"
).count
LearyCJY 2012-11-24
  • 打赏
  • 举报
回复
我是想要时间段内有购物记录的用户数,比如当天往前推一个月内的订单明细里面的用户数为当天活跃用户数,要查这样的,然后是想要放到一个计算字段里面去。
Mr_Nice 2012-11-23
  • 打赏
  • 举报
回复
没有在后面做过非重复,一般在筛选集合数据的时候,已经做好。后期cube的mdx计算起来比较简单。
  • 打赏
  • 举报
回复
我不知道你是要计算在一定时间内的注册用户数,还是有购物记录的用户数,其实这两个在处理上是一样的,所以这个问题应该是很容易处理的
  • 打赏
  • 举报
回复
计算一段时间内的用户数量 ,我们使用 exists 来判断一个用户是否买过物品,具体察看exists的用法,这里我们没有定义时间段而是直接使用了年来作为各个时间段,我们可以根据实际要求来自己定义需要的set区间 WITH MEMBER [Measures].[CustomerNum] AS ( EXISTS([Customer].[Customer].[Customer],,"Internet Sales") ).COUNT SELECT {[Measures].[Internet Sales Amount],[Measures].[CustomerNum]} ON 0, [Date].[Calendar].[Calendar Year] ON 1 FROM [Adventure Works] 如果我们只关注用户数量我们可以把度量去掉 WITH MEMBER [Measures].[CustomerNum] AS ( EXISTS([Customer].[Customer].[Customer],,"Internet Sales") ).COUNT SELECT {[Measures].[CustomerNum]} ON 0, [Date].[Calendar].[Calendar Year] ON 1 FROM [Adventure Works]

594

社区成员

发帖
与我相关
我的任务
社区描述
提出问题
其他 技术论坛(原bbs)
社区管理员
  • community_281
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧