简体   繁体   English

无法在 SSRS 中创建嵌套的 SUM IIF 表达式

[英]Trouble creating nested SUM IIF expression in SSRS

I am new to SSRS and have a SUM(IIF question.我是 SSRS 的新手,有一个 SUM(IIF 问题。

My data set contains four columns: Date, GroupID, PlanPaid, and NetworkIndicator.我的数据集包含四列:Date、GroupID、PlanPaid 和 NetworkIndicator。

Here is an example of the data set:这是数据集的示例:

在此处输入图像描述

I am trying to SUM the [PlanPaid] amount when [NetworkIndicator] = "In Network".当 [NetworkIndicator] = "In Network" 时,我正在尝试对 [PlanPaid] 金额求和。

However, I need this amount broken up by the [Date].但是,我需要按 [Date] 拆分的金额。 I tried accomplishing this by creating the expression:我尝试通过创建表达式来完成此操作:

=Sum(IIf(Fields.NetworkIndicator,Value = "In Network". Fields,PlanPaid,Value , Nothing) , "Claims_Rolling12") =Sum(IIf(Fields.NetworkIndicator,Value = "In Network".Fields,PlanPaid,Value , Nothing) , "Claims_Rolling12")

But this expression returns the same amount (total) across all [Dates].但是此表达式在所有 [Dates] 中返回相同的金额(总计)。 How do I break it up so that it is grouped by the correct [Date]?我如何分解它以便按正确的 [Date] 分组?

Here is a photo of my Tablix and my current Groups: [Tablix and Groups]这是我的 Tablix 和当前群组的照片:[Tablix 和群组]

在此处输入图像描述

And here is a photo of the output: [Output]这是 output 的照片:[输出]

在此处输入图像描述

You haven't said where you want this sum to appear, so the answer here might not work.你还没有说你希望这笔款项出现在哪里,所以这里的答案可能不起作用。 If it doesn't then edit your question to show what you expect the output to look like based on your sample data.如果没有,则编辑您的问题以根据您的示例数据显示您期望 output 的外观。

I'm assuming here that you want to add a new column to the report that shows "In Network total" by date.我在这里假设您要向报告中添加一个新列,按日期显示“在网络中的总数”。

The easiest way to do this is to add a row group that groups by date, then within this group you can use a simple expression, like the one you tried, but without specifying the scope.最简单的方法是添加一个按日期分组的行组,然后在该组中您可以使用一个简单的表达式,就像您尝试过的那样,但不指定 scope。

=SUM(IIF(Fields!NetworkIndicator.Value = "In Network", Fields!PaidPlan.Value, Nothing))

This expression will only sum rows that are within the current scope, in this case the scope will be the row group you created to group by dates.此表达式仅对当前 scope 中的行求和,在本例中,scope 将是您创建的按日期分组的行组。

As IO said, if this is not helpful, edit your question and show what you expect your end result to look like, based on the sample data you supplied and then I can look at it again.正如 IO 所说,如果这没有帮助,请根据您提供的样本数据编辑您的问题并显示您期望的最终结果,然后我可以再次查看。

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

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