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)
 Calculation and scope question

Author  Topic 

1sabine8
Posting Yak Master

130 Posts

Posted - 2010-02-19 : 06:51:33
Hi,
I'm building a table where i have 4 columns "Type" (grouping column), "Negative/Positive"(grouping column), Count (the count of the Negative/Positive type), Percentage (% of the Negative/Positive count from the total count (positive+negative) per row). I want the percentage on the row (Positive or Negative) to be taken from the count (sum of positive and negative per row). How can i perform that?
Thanks in advance

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-19 : 07:11:12
do you mean this?

=count(Fields!YourField.Value)*1.0/count(Fields!YourField.value,"dataset")

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

1sabine8
Posting Yak Master

130 Posts

Posted - 2010-02-19 : 08:23:10
Well if it was that way, it surely would have worked but the issue is i need to use the same formula but get the percentage not from the whole dataset count (count(Fields!YourField.value,"dataset")) but from the count of the records/ section in the group by. ex:type 1 total count (positive +negative)
Any idea?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-19 : 09:23:27
quote:
Originally posted by 1sabine8

Well if it was that way, it surely would have worked but the issue is i need to use the same formula but get the percentage not from the whole dataset count (count(Fields!YourField.value,"dataset")) but from the count of the records/ section in the group by. ex:type 1 total count (positive +negative)
Any idea?


you can use any scope value. so if you need count of group use

count(Fields!YourField.value,"your group")

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -