翻译介绍15个经典的MDX查询-08&09

本文通过两个MDX查询示例讲解如何使用MDX来分析数据。第一个查询展示了如何找出每个品牌销售最好的两种产品及其在总销售额中的比例。第二个查询则演示如何高亮显示过去四个季度中销售排名后10%的品牌,通过单元格属性进行异常突出显示。
摘要由CSDN通过智能技术生成
8. For each product brand, what are the two top-selling products and what percentage of total sales do they make up? To answer this question, Listing 8's relatively complicated query uses a combination of a calculated member and the Generate() function. The calculated member determines the percentage of the brand's total unit sales that a brand's top two products make up. The Generate() function searches the list of all brands and returns a set of each brand's top two products and the percent of total value that those products account for.
查出每一种品牌销售最好的两种产品的销量额,以及分别占销售总额的百分比。 Listing8相对比较复杂,综合运用了计算成员和Generate()函数。计算成员确定了每个品牌销售最好的前两个产品占所在品牌unit sales总量百分比。Generate函数查询每个品牌并返回每个品牌下销售最好的两个产品,以及每个产品的销售额和百分比。
  Listing_08.Determining Two Top-Selling Products.txt
说明:查出每种品牌 2 产品的销售记录,以及各自分别占所在品牌的百分比
 
with member [Measures].[PercTotalSales] as
' Sum ( TopCount ([Product] .CurrentMember.Children , 2, [Unit Sales]), [Unit Sales] )
/([Product] .CurrentMember , [Unit Sales])',
FORMAT_STRING = '##.0%'
select [Store].[(All)] .Members on COLUMNS ,
  Generate ( [Product].[Brand Name] .Members ,
   Union (
      TopCount ( [Product] .CurrentMember.Children , 2, [Unit Sales] ) * {[Unit Sales]},
      { ([Product] .CurrentMember
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值