WEB开发网
开发学院数据库MSSQL Server 一步一步学习sqlserver BI--应用开发 阅读

一步一步学习sqlserver BI--应用开发

 2008-11-24 10:10:34 来源:WEB开发网   
核心提示: /** <summary>/// 按天统计各个游戏单个部门的交易数据/// </summary>/// <param name="tradeDateKey">日期的键值</param>/// <returns>

/**//// <summary>

    /// 按天统计各个游戏单个部门的交易数据
    /// </summary>
    /// <param name="tradeDateKey">日期的键值</param>
    /// <returns></returns>
    public CellSet Count(int tradeDateKey,int departmentKey)
    {
      StringBuilder mdxBuilder = new StringBuilder();
      mdxBuilder.Append("WITH MEMBER [Measures].[Total Orders Count] AS 'SUM([Measures].[Total Orders] )' ");
      mdxBuilder.Append(" MEMBER [Measures].[Total Amount Count] AS 'SUM([Measures].[Total Amount])'");
      mdxBuilder.Append(" MEMBER [Measures].[Total Money Count] AS 'SUM([Measures].[Total Money])'");
      mdxBuilder.Append(" MEMBER [Measures].[Un Paid Cancel Amount Count] AS 'SUM([Measures].[Un Paid Cancel Amount])'");
      mdxBuilder.Append(" MEMBER [Measures].[Un Paid Cancel Money Count] AS 'SUM([Measures].[Un Paid Cancel Money])'");
      mdxBuilder.Append(" MEMBER [Measures].[Paid Cancel Amount Count] AS 'SUM([Measures].[Paid Cancel Amount])'");
      mdxBuilder.Append(" MEMBER [Measures].[Paid Cancel Money Count] AS'SUM([Measures].[Paid Cancel Money])'");
      mdxBuilder.Append(" SELECT { [Measures].[Total Orders Count], [Measures].[Total Amount Count], [Measures].[Total Money Count], [Measures].[Un Paid Cancel Amount Count], [Measures].[Un Paid Cancel Money Count], [Measures].[Paid Cancel Amount Count], [Measures].[Paid Cancel Money Count]} ON COLUMNS,");
      mdxBuilder.Append(" {[Game].[Game Code Alternate Key].Members} ON ROWS");
      mdxBuilder.Append(" FROM [Data Center DW]");
      mdxBuilder.Append(" WHERE ([Time].[TimeKey].[" + tradeDateKey + "],[Department].[Dim Department].["+departmentKey.ToString()+"])");
  
      return DBServer.AnalysisServer.ExecuteCellset(mdxBuilder.ToString());
    }   

上一页  1 2 3 4  下一页

Tags:学习 sqlserver BI

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接