Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 RS - Using two dataset for computation

Author  Topic 

larryesurat
Starting Member

1 Post

Posted - 2009-02-27 : 01:25:48
I'm facing a big challenge in reporting services. Using two dataset for computation

Please see below for details.

sample data
Employee WeekEnding Date A B C D
00001 27-Feb 23-Feb 1 3 0.33 3
00001 27-Feb 24-Feb 1 2 0.50 4
00001 27-Feb 25-Feb 1 7 0.14 2
00001 27-Feb 26-Feb 2 5 0.40 3
00001 27-Feb 27-Feb 1 6 0.17 2
TOTAL 6 23 0.26 2

Formula:
C = A/B
D = If (Date between EffectiveStartDate and EffectiveEndDate) and C between Floor and Ceiling then Amount else 0

rule in computing D: If Date fall under the EffectiveStartDate and EffectiveEndDate of Reference and if current row in C fall between Floor and Ceiling from the Reference, then use the Amount that satisifies the condition.

Reference
Floor Ceiling Amount EffectiveStartDate EffectiveEndDate
0.1 0.29 2 2/1/2009 2/28/2009
0.3 0.49 3 2/1/2009 2/28/2009
0.5 0.69 4 2/1/2009 2/28/2009
0.7 1 5 2/1/2009 2/28/2009

What I did was made the calculation in sql and stored it in column D. In reporting services, it computes the TOTAL as the summation of D. What I want to solve is the TOTAL should also compute based on the reference table
In reporting services TOTAL in column D returns 14. Expected result should be 2.
Is there a way in doing this in expressions. Compute for column D based on reference Dataset?

Thanks for any idea that you may share in solving this.

Regards,
Larry

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 13:01:27
you can give scope as Reference dataset while using aggregate function. something like
SUM(your field here,"Reference")
Go to Top of Page
   

- Advertisement -