SSRSレポートには、2つのグループ(アカウント、月)があります。アカウントは親です。月は子グループです。今度は、各月の期末残高を次月の初めの残高として表示したいと考えています。サンプルレポートは次のとおりです。赤いフォントは各グループのSUMを示します。 SSRS Previous()関数を使用して結果を取得しようとしていますが、期待される結果を得ることはできません。SSRSの行の前の値を取得する方法
Previous(Sum(Fields!NetAmt.Value),"Month")
月=>月のグループ名。
誰でも助けてくれますか?
ありがとうございます。
ラシッド
サンプルSQLはデータ
CREATE TABLE [dbo].[Balances](
[id] [int] IDENTITY(1,1) NOT NULL,
[Account] [nvarchar](50) NULL,
[Month] [date] NULL,
[BegBalance] [float] NULL,
[Debit] [float] NULL,
[Credit] [float] NULL,
[EndBalance] [float] NULL,
CONSTRAINT [PK_Balances] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Balances] ON
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (1, N'Cash', CAST(0xDB3A0B00 AS Date), 0, 100, 50, 50)
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (2, N'Cash', CAST(0xDB3A0B00 AS Date), 0, 200, 50, 150)
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (3, N'Cash', CAST(0xFA3A0B00 AS Date), 0, 200, 50, 150)
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (4, N'Cash', CAST(0xFA3A0B00 AS Date), 0, 200, 100, 100)
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (5, N'Mr. Axxx', CAST(0xDB3A0B00 AS Date), 0, 200, 100, 100)
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (6, N'Mr. Axxx', CAST(0xDB3A0B00 AS Date), 0, 100, 50, 50)
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (7, N'Mr. Axxx', CAST(0xFA3A0B00 AS Date), 0, 100, 50, 50)
INSERT [dbo].[Balances] ([id], [Account], [Month], [BegBalance], [Debit], [Credit], [EndBalance]) VALUES (8, N'Mr. Axxx', CAST(0xFA3A0B00 AS Date), 0, 100, 20, 80)
SET IDENTITY_INSERT [dbo].[Balances] OFF
サンプルデータを追加できますか?私はそれが達成できると思います。 –