zoukankan      html  css  js  c++  java
  • 实现百分比和百分比的累加以及A、B、C类别的标识

    with
    member [Measures].[Total Sales]  as 'Sum({[Product].[Brand].[Brand].members},[Measures].[Ending Inventory Cost])',format_string="#,#.00"
    member [Measures].[Rate]            as [Measures].[Ending Inventory Cost]/[Measures].[Total Sales],format_string='0.00%'
    set         [Brand]                             as 'AddCalculatedMembers({order({[Product].[Brand].[Brand]},[Measures].[Rate],desc)})'
    set         [BrandAsc]                       as 'AddCalculatedMembers({order({[Product].[Brand].[Brand]},[Measures].[Rate],asc)})'
    member [measures].[EIC]              as '[measures].[Ending Inventory Cost]',format_string="#,#.00"
    member [measures].[code]             as '(Rank([Product].[Brand].currentmember, {AddCalculatedMembers({order({[Product].[Brand].[Brand]},[Measures].[Rate],desc)})}))'//,format_string='0.00%'
    member [measures].[Accumul]      as '(sum(tail({[BrandAsc]},[code]),[Measures].[Rate]))',format_string='0.00%'
    member [measures].[Flag]              as case when [Measures].[Accumul] <= 0.75 then 'A' when [Measures].[Accumul] > 0.75 and [Measures].[Accumul] <= 0.99 then 'B' else 'C' end

    select
         {[Measures].[Flag],[Measures].[EIC],[Measures].[Rate],[Measures].[Accumul]} on 0
        ,[Brand] on 1
    from [Stock OnHand SnapShot]

  • 相关阅读:
    XmLHttpRequst下载Excel
    mysq for visual studio 1.1.1
    滚动条样式设置
    正则
    比较偏门的JVM语言Quercus
    OMG 在线思维导图都有开源的
    从几篇文字得到关于web app开发的性能问题的答案
    用linux遇到的一个死循环
    有道笔记
    FreeBSD 10 发布
  • 原文地址:https://www.cnblogs.com/chunshen/p/2582252.html
Copyright © 2011-2022 走看看