zoukankan      html  css  js  c++  java
  • 环比

    WITH
    MEMBER [Measures].[销售台次当月计划] AS ([日期].[年-月-日].parent,([目标类型].[目标类型名称].&[财务精品收入],[Measures].[门店月目标值]))

    MEMBER [Measures].[本月收入] AS iif(sum(mtd([日期].[年-月-日]),(iif([Measures].[财务精品收入]=null,0,[Measures].[财务精品收入])))=0,null,sum(mtd([日期].[年-月-日]),(iif([Measures].[财务精品收入]=null,0,[Measures].[财务精品收入])))) 

    MEMBER [Measures].[销售台次当月累计] AS [Measures].[本月收入]   

    MEMBER [Measures].[上月当日销售台次合计] AS (PARALLELPERIOD( [日期].[年-月-日].[月],1,[日期].[年-月-日]),[Measures].[财务精品收入])  

    MEMBER [Measures].[上年当日销售台次合计] AS (PARALLELPERIOD( [日期].[年-月-日].[年],1, [日期].[年-月-日] ),[Measures].[财务精品收入])  

    MEMBER [Measures].[上月月累计销售台次合计] AS iif(sum(mtd([日期].[年-月-日]),(iif([Measures].[上月当日销售台次合计]=null,0,[Measures].[上月当日销售台次合计])))=0,null,sum(mtd([日期].[年-月-日]),(iif([Measures].[上月当日销售台次合计]=null,0,[Measures].[上月当日销售台次合计])))) 

    MEMBER [Measures].[上年月累计销售台次合计] AS iif(sum(mtd([日期].[年-月-日]),(iif([Measures].[上年当日销售台次合计]=null,0,[Measures].[上年当日销售台次合计])))=0,null,sum(mtd([日期].[年-月-日]),(iif([Measures].[上年当日销售台次合计]=null,0,[Measures].[上年当日销售台次合计]))))

    MEMBER [Measures].[同比增长] AS  iif([Measures].[上年月累计销售台次合计]=0,null,iif([Measures].[销售台次当月累计]=0,-1,[Measures].[销售台次当月累计]/[Measures].[上年月累计销售台次合计]-1)) 

    MEMBER [Measures].[环比增长] AS iif([Measures].[上月月累计销售台次合计]=0,null,iif([Measures].[销售台次当月累计]=0,-1,[Measures].[销售台次当月累计]/[Measures].[上月月累计销售台次合计]-1)) 

    MEMBER [Measures].[当月累计达成率] AS

    iif([Measures].[销售台次当月累计]=0 or [Measures].[销售台次当月计划]=0,null,[Measures].[销售台次当月累计]/[Measures].[销售台次当月计划])

    SELECT 

    [Measures].[上年月累计销售台次合计], [Measures].[同比增长], [Measures].[环比增长], [Measures].[当月累计达成率],

    [Measures].[上月月累计销售台次合计], [Measures].[销售台次当月计划], [Measures].[销售台次当月累计] } ON COLUMNS,

    NON EMPTY { ([门店信息].[管辖区域].MEMBERS ) } on 1

    from [KPI]where [日期].[年-月-日].[年].&[2010].&[10].&[2010-10-31T00:00:00]

    WITH
    MEMBER [Measures].[本月整车销售台次] AS [Measures].[销售量]

    MEMBER [Measures].[前一月整车销售台次] AS ([Measures].[本月整车销售台次],ParallelPeriod ([日期].[年-月].[月] , 1,[日期].[年-月]))

    MEMBER [Measures].[前两月整车销售台次] AS ([Measures].[本月整车销售台次],ParallelPeriod ([日期].[年-月].[月],2, [日期].[年-月]))

    MEMBER [Measures].[去年当月整车销售台次] AS ([Measures].[本月整车销售台次],ParallelPeriod ([日期].[年-月].[年],1,[日期].[年-月]))

    MEMBER [Measures].[本年累计整车销售台次] AS iif(sum(ytd([日期].[年-月]),(iif([Measures].[销售量]=null,0,[Measures].[销售量])))=0,null,sum(ytd([日期].[年-月]),(iif([Measures].[销售量]=null,0,[Measures].[销售量]))))

    MEMBER [Measures].[去年累计整车销售台次] AS iif(sum(ytd([日期].[年-月]),(iif([Measures].[去年当月整车销售台次]=null,0,[Measures].[去年当月整车销售台次])))=0,null,sum(ytd([日期].[年-月]),(iif([Measures].[去年当月整车销售台次]=null,0,[Measures].[去年当月整车销售台次]))))  

    MEMBER [Measures].[当月计划整车销售台次] AS ([目标类型].[目标类型名称].&[总销量],[Measures].[门店月目标值]) MEMBER [Measures].[当年计划整车销售台次] AS ([日期].[年-月].parent,([目标类型].[目标类型名称].&[总销量],[Measures].[门店年目标值]))

    MEMBER [Measures].[当年月累加计划整车销售台次] AS iif(sum(ytd([日期].[年-月]),(iif([Measures].[当月计划整车销售台次]=null,0,[Measures].[当月计划整车销售台次])))=0,null,sum(ytd([日期].[年-月]),(iif([Measures].[当月计划整车销售台次]=null,0,[Measures].[当月计划整车销售台次])))) 


    SELECT

    { [Measures].[当月计划整车销售台次], [Measures].[去年累计整车销售台次], [Measures].[当年月累加计划整车销售台次], [Measures].[当年计划整车销售台次],
    [Measures].[本年累计整车销售台次], [Measures].[前两月整车销售台次], [Measures].[前一月整车销售台次], [Measures].[本月整车销售台次], [Measures].[去年当月整车销售台次] } ON COLUMNS

    FROM [KPI] where [日期].[年-月].[年].&[2010].&[8]


     

  • 相关阅读:
    Cannot resolve symbol 'SpringBootApp
    Java读取ZIP文件ZipEntry.getsize()总是返回-1?
    java 读取zip里面的xml文件
    导出:xml zip
    jquery form submit提交方式
    [转][C#]无法创建虚拟目录。ASP.NET 2.0 尚未在 Web服务器上注册。
    [转][C#].Net反编译利器
    [转][echarts]地图轮播
    [转][C#]AutoFac 使用方法总结
    [转]用代码访问 Https
  • 原文地址:https://www.cnblogs.com/emmy/p/1961991.html
Copyright © 2011-2022 走看看