SSRS:添加基于2个数据集的矩阵
我刚刚开始使用 SSRS,并弄清楚如何将我的 MDX 查询连接到多维数据集并将其插入矩阵
但是,我需要有一个矩阵,并且在每个部分中,我需要调用不同的数据集。
例如:
Matrix1 将具有基于 DataSetA 的重复部分(假设其客户中心)。
在 Matrix1 的每个部分(客户中心)中,我都会有一个表达式,它调用 DatasetB,使用 DataSetA 中的值作为参数 (假设这将是一个单独的 MDX 查询,根据客户中心 ID 获取一些其他信息)。
所以我在 tablix 单元格中的表达式是这样的:
=First(Fields!MTD_Trades.Value, "DatasetB")
是否可以使用此时的参数传递 MDX 查询过滤器(或 where 子句)?
理想情况下,它会是这样的(伪代码):
=First(Fields!MTD_Trades.Value, "DatasetB") WHERE Fields!Where_Filter.Value
沿着这些线的东西..其中 MDX WHERE 部分是基于另一个查询
UPDATE 动态的 - 这里的解决方案解释
是我正在做的一个示例:假设该应用程序基于空中交通,并且这里的业务用户是某个航空当局人员。我会给那个人一个用户界面,让他们定义他们想要看到的切片。例如,他们可以进来并创建 n 个切片(即国际航班、离开美国的航班、午夜后到达的航班、超过 50 名乘客的航班...n)。正如您所看到的,他们可以自由地向每个切片添加他们想要的任何过滤器。
然后根据他们的操作(使用 GUI),我将生成必要的 MDX 查询(每个切片一个)。
我在这里面临的挑战是创建一个 SSRS 报告,该报告将为每个切片 (1-n) 显示单独的一行。希望这有助于理解我的难题。对于每个切片(航班数量),查询的第一部分将相同,但报告的 WHERE 部分将不同且动态。
I just started working with SSRS, and figured out how to connect my MDX Query to a Cube and plug that into a Matrix
However, i need to have a matrix, and in each section, i need to call a different DataSet.
For example:
Matrix1 would have a repeating section based off DataSetA (let's say its customer centers).
in each section (customer center) of Matrix1 i would have a Expression, which calls DatasetB, using a value from DataSetA as parameter (let's say it would be a separate MDX query getting some other information based on customer center ID).
so my expression from within a tablix cell is something like this:
=First(Fields!MTD_Trades.Value, "DatasetB")
is it possible to pass a MDX query filter (or where clause) using a parameter from this point?
ideally it would be something like this (pseudo code):
=First(Fields!MTD_Trades.Value, "DatasetB") WHERE Fields!Where_Filter.Value
something along these lines.. where the MDX WHERE section is dynamic based off another query
UPDATE - solution explanation
here is an example of what i am doing: Let's say the application is based on air traffic and the business user here is some aviation authority person. I will give that person a UI that will let them define the slices they want to see. For example they can come in, and create n slices (i.e. International Flights, Flights leaving US, Flights Arriving After Midnight, Flights with 50+ passengers... n). As you can see, they will have the freedom of adding any filters they wish to each slice.
Then based on their actions (using GUI), i will generate the necessary MDX queries (one for each slice).
My challenge here is to create a SSRS report that will show a separate line for each one of those slices (1-n). Hope that helps in understanding my conundrum. The first part of the query will be the same for each slice (# of flights), but the WHERE section will be different and dynamic for the report.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
lookup()
函数从报表项中访问另一个数据集中的数据,但不能在报表中运行多个子查询。您只能在参数内执行此操作,其中一个参数可以是另一个查询驱动参数的输入。最好的做法是修改原始查询以包含矩阵所需的所有数据。
编辑:听起来您需要使用多值参数。
允许多个值
=Join(Parameters!Slices.值,",")
。You can use the
lookup()
function to access data in another dataset from within a reportitem but you cannot run multiple sub-queries within the report. You can only do this within the parameters where one parameter can be an input for another query driven parameter.The best course of action is to modify your original query to contain all the data you need for the Matrix.
EDIT: It sounds like you need to use a multivalue parameter.
allow multiple values
=Join(Parameters!Slices.Value,",")
.