MDX 查询返回除之前时间段的客户之外的客户列表
我在编写 2 个 MDX 查询时遇到问题:
1) 一个查询应该返回所有客户(具有相应的销售额),这些客户在过去 3 个完成的月份中进行了购买(每个月至少 1 次购买),但没有在这 3 个月之前的几个月内进行过任何购买(起始期间为当年年初)
2) 一个查询,应返回所有在过去 3 个完成的月份内未进行过购买的客户(具有相应的销售额) (每个月没有购买),但是在这 3 个月之前的几个月内进行过任何购买(起始期间是当年年初)
OLAP 多维数据集的基础 DWH 结构如下:
有一个名为factPurchases 的事实表(包含 salesAmount 列,该列也是多维数据集中的度量),以及这些维度表:dimCustomer 和 dimDate(具有层次结构级别“年”、“月”、“日”)。
我一直停留在如何从结果中过滤掉“不需要的”客户的问题上。有人可以帮我吗?
I have a trouble writing 2 MDX queries:
1) A query that should return all customers (with corresponding sales amount), which have made a purchase in the last 3 finished months (at least 1 purchase in each month), and didn't make any purchase in the months before those 3 months (the starting period is the beginning of the current year)
2) A query that should return all customers (with corresponding sales amount), which have NOT made a purchase in the last 3 finished months (no purchase in each month), but made any purchase in the months before those 3 months (the starting period is the beginning of the current year)
The structure of underlying DWH for the OLAP cube is following:
There is one fact table called factPurchases (containing the salesAmount column, which is also a measure in the cube), and these dimension tables: dimCustomer, and dimDate (with hierarchy levels Year, Month, Day).
I've stuck at the point, how to filter out the "not-wanted" customers out of the results. Can anybody help me, please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么 except 函数呢?是不是不起作用?
What about the Except function? Is it not working?