简体   繁体   English

SSAS多维数据集并使用MDX获取数据以获取SSRS报告

[英]SSAS cube and getting data with MDX for SSRS report

I'm new to OLAP cubes. 我是OLAP多维数据集的新手。 Can you directed in the right direction with small example. 您能否举一个小例子来指引正确的方向?

Let's say I have table "transactions" with 3 columns: transaction_id (int), date (datetime), amount (decimal(16,2)). 假设我有3列的表格“ transactions”:transaction_id(int),日期(datetime),金额(decimal(16,2))。

I want to create a cube and then get data with MDX query for SSRS report. 我想创建一个多维数据集,然后使用MDX查询SSRS报告获取数据。 I want report to show something like: 我希望报告显示类似以下内容: 在此处输入图片说明

Ok. 好。 I know i can have fact table with amount and date dimention (date->month->year). 我知道我可以有数量和日期尺寸(日期->月->年)的事实表。

Can you explain what to do in order to get this result (including how to write MDX query). 您能解释一下如何获得此结果(包括如何编写MDX查询)。 Thanks. 谢谢。


Can someone explain why I get amount of full 201504 and 201606 months even if I specified exact range with days? 有人可以解释为什么即使我指定了几天的确切范围,我也能得到全部201504和201606个月的金额?

SELECT
     [Measures].[Amount] ON COLUMNS
    ,[Dim_Date].[Hierarchy].[Month].MEMBERS ON ROWS
FROM
    [DM]
WHERE
    (
       {[Dim_Date].[Date Int].&[20150414] : [Dim_Date].[Date Int].&[20160615]}
    )

So you want someone to show you how to create a multi-dimensional cube from scratch and report on it in a single answer...? 因此,您希望有人向您展示如何从头开始创建多维多维数据集,并在一个答案中对其进行报告...吗? Start here and work through the lessons 这里开始并完成课程

Something like below, change the query accordingly :) 如下所示,相应地更改查询:)

SELECT  
    { [Date].[EnglishMonthName].[EnglishMonthName]} ON COLUMNS,  
    { [Date].[DateHierarchy].[Year].&[2015],   
        [Date].[DateHierarchy].[Year].&[2016] } ON ROWS  
FROM [YourCubeName]
WHERE ([Measures].[amount])  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM