Difficulty Calculating Percentages in Matrix

  • Hi I have a matrix where im trying to calc some percentages using:

    =COUNT(Fields!TaskID.Value)/COUNT(Fields!TaskID.Value, "dataset1")

    However I get a;

    "The Value expression for the text box ‘TaskID’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset."

    error message

    Can anyone help me with this, I'm new to ssrs and have looked at the inscope function but I dont understand it.

    Any help greatly appreciated

    Cheers

    Carl.

  • You can put that 2nd count in a textbox, name the textbox something meaningful and then use the textbox value as such :

    ReportItems!txtSumValeurOuvertCUPA.Value

  • Even doing COUNT(Fields!TaskID.Value, "dataset1") in a text box gives the same error!

  • Ok then, use a tablix, set the dataset for the tablix and then do count(*) in 1 column. That should work.

    If not try sum(1).

  • This is my matrix:

    PeriodNumber

    PeriodYear Asset Sub_Asset Visit_Status Total Total

    Total

    Total

    Total

    I want to be able to show the percentage of each Visit_Status against each periodnumber total

    I'm not sure I'm explaining this very well.

  • Please post sample data and required output formatted in the matrix.

  • I want the percentage of each visit status against each total within the period number ir period 1, period 2 etc

  • carl.meads (5/24/2011)


    I want the percentage of each visit status against each total within the period number ir period 1, period 2 etc

    I can't see your image (on your desktop). Upload it as an attachement.

  • file attached

  • You can name a textbox in the grouping sections and use that as a dividor.

  • Can you give step by step instructions, I dont know how to do that!

  • You should first double check that you have the correct dataset or group name typed in correctly, the scope name is case sensitive. I've tested a tablix of mine that looks similar to yours and got COUNT(Fields!MyField.Value, "mydataset") to work fine. I then tried COUNT(Fields!MyField.Value, "Mydataset") - and got the exact error you got. So check your data set name including the case - I usually copy the dataset name from the dataset properties box and then paste it into my field expression so I know that I didn't fat finger the name. The other thing to check is that the field that you are trying to count is actually a field in the data set that you are specifying tin the COUNT function. You may just be referencing the wrong field name or data set name.

    Thanks,

    MWise

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply