简体   繁体   中英

Trouble creating nested SUM IIF expression in SSRS

I am new to SSRS and have a SUM(IIF question.

My data set contains four columns: Date, GroupID, PlanPaid, and NetworkIndicator.

Here is an example of the data set:

在此处输入图像描述

I am trying to SUM the [PlanPaid] amount when [NetworkIndicator] = "In Network".

However, I need this amount broken up by the [Date]. I tried accomplishing this by creating the expression:

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

But this expression returns the same amount (total) across all [Dates]. How do I break it up so that it is grouped by the correct [Date]?

Here is a photo of my Tablix and my current Groups: [Tablix and Groups]

在此处输入图像描述

And here is a photo of the 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.

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.

=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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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