Wrox Programmer Forums
|
Reporting Services SQL Server Reporting Services. Please specify which version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Reporting Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 18th, 2006, 01:34 PM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Sum()

Hello,

I have problem with aggregation methods in RS 2005. I have a query thar returns data set:

Department, Storage, Article, Invoice, Quantity, Value, ValueX
3,1,'Art A','Inv 1',2,30,5
3,1,'Art B','Inv 1',4,40,7

3,1,'Art A','Inv 2',1,15,5
3,1,'Art B','Inv 2',2,20,7

3,2,'Art A','Inv 3',1,18,3
3,2,'Art B','Inv 3',2,16,4

ValueX - this is value returned by UDF. It is unique for every "Article & Storage group".

In RS my report looks like this:

(grpDepartment) Department, Sum(Quantity), Sum(Value), Sum(ValueX, scope?)
(grpStorage) +Storage, Sum(Quantity), Sum(Value), Sum(ValueX, scope?)
(grpArticle) ++Article, Sum(Quantity), Sum(Value), ValueX
(detInvoice) +++Invoice, Quantity, Value
And the data looks like this:

(grpDepartment) 3, 12, 139, 31(24+7) <- should be 19(12+7)
(grpStorage) 1, 9, 105, 24(5+5+7+7) <- should be 12(5+7)
(grpArticle) ”Art A”, 3, 45, 5
(detInvoice) ”Inv 1”, 2, 30
                   â€Inv 2”, 1, 15
(grpArticle) ”Art B”, 6, 60, 7
                   â€Inv 1”, 4, 40
                   â€Inv 2”, 2, 20
(grpStorage) 2, 3, 34, 7(3+4) <- ok only because there is 1 detail row for each Article
(grpArticle) ”Art A”, 1, 18, 3
                   â€Inv 3”, 1, 18
(grpArticle) ”Art B”, 2, 16, 4
                   â€Inv 3”, 2, 16

The Sum() error is because I sum ValueX from details, and I should sum it from "grpArticle". Unfortunately I cannot. I've tried to use Sum(ValueX,"grpArticle") but I can use it only in "details" and "grpArticles". In "upper" groups ("grpStorage" and "grpDepartment") it generates error.

Any help in here ? :|

Maciej


Maciej





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Running Sum (or Cumulative Sum) timdasa VB Databases Basics 1 August 22nd, 2006 03:12 PM
Sum on a form Problem Corey Access 1 November 9th, 2005 05:43 PM
Sum function accuracy problem nuthib Crystal Reports 1 June 21st, 2004 02:12 AM
sum function problem sherr8 Access 1 February 13th, 2004 03:06 PM
Aggregate Sum Problem akc SQL Server 2000 2 November 4th, 2003 10:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.