好奇怪???
总见有人问MDX语句,可为什么我做的BI项目从来没有用过MDX呢?有没有人能跟我说说MDX到底怎么回事呀!或许做项目能有更好的方法,呵呵,希望各抒己见,盼复!!
[解决办法]
查出最近6个月销售趋势最好的前10个商品及其各自销售量 withset [TenBest] as 'TopCount( [Product].[Brand Name].Members, 10, [Unit Sales] )' set [LastMonth] as 'Tail(Filter([Time].[Month].Members, NotIsEmpty([Time].CurrentMember)),1)' set [Last6Months] as ' [LastMonth].item(0).item(0).Lag(6) : [LastMonth].item(0).item(0)'select [Last6Months] onCOLUMNS, [TenBest] onROWSfrom Sales找出组成销售额80%的商品销售及其记录;select {[Unit Sales]} onCOLUMNS,TopPercent([Product].[Brand Name].Members, 80, [Unit Sales]) onROWSfrom Sales按销售量排序,找出组成20%销售量的商品销售记录select {[Unit Sales]} onCOLUMNS, NonEmptyBottomPercent([Product].[Brand Name].Members, 20, [Unit Sales]) onROWSfrom Sales查出销售量最好的前5名店和每个店的前5个顾客及其销售记录 select {[Unit Sales]} onCOLUMNS, Generate( TopCount([Store].[Store Name].Members, 5, [Unit Sales]), { [Store].CurrentMember } * TopCount( [Customers].[Name].Members, 5, ([Unit Sales], [Store].CurrentMember) ) ) onROWSfrom Sales