Problems in CALCULATING PERCENTAGE in SSRS 2005 Reports..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aswanth
    New Member
    • Feb 2008
    • 14

    Problems in CALCULATING PERCENTAGE in SSRS 2005 Reports..

    I'm Using Asp.Net with C# & Working with SSRS 2005 for Generating Reports..

    The Following Expression I'm using in Reports to Show the Percentage of Particular Items in REPORT..

    =Round((Fields! Clicks.Value*10 0)/Sum(Fields!Clic ks_Show.Value, "DataSet1_Get_A ll_1234567"),2) & "%"

    With this Expression I'm Getting Reports Percentage(Tota l) 100%(NO Problem)..

    But for Some Reports it is Coming >100 or < 100 Total Percentage (ie 105% or 95%, --)..

    For Some Reports, I'm Getting SAME PERCENTAGE VALUES to All Items..
    ie In One Report Assume I'm having 4 Items.. I'm Getting ONE Percentage Value to All Items in That REPORT.. Just Like 35%,35%,35%,35% ).. But when we Calculate the Items Percentage Values SEPERATELY RESULT is Different (Just Like 35%, 15%, 30%, 20%)..

    I want to Give TOTAL Percentage for ONLY 100% for Reports..

    How to do this..

    What is the Wrong in My Expression.. Why It is Giving Correct Percentage for Few Reports & Wrong Result to Remaining Reports.. & Also Why Same Percentage Values are Repeating for All Items in Few REPORT's...


    Thank You..
  • deric
    New Member
    • Dec 2007
    • 92

    #2
    Originally posted by Aswanth
    =Round((Fields! Clicks.Value*10 0)/Sum(Fields!Clic ks_Show.Value, "DataSet1_Get_A ll_1234567"),2) & "%"
    Is Clicks the same with Clicks_Show? If not, what is Clicks_Show?
    I think that is where the problem is... you need to get and use the same values.

    Comment

    • Aswanth
      New Member
      • Feb 2008
      • 14

      #3
      Originally posted by deric
      Is Clicks the same with Clicks_Show? If not, what is Clicks_Show?
      I think that is where the problem is... you need to get and use the same values.
      No Clicks & Clicks_Show are Different..
      Clicks is One Column & Clicks_Show is Another Column..

      Comment

      • rjvrnjn
        New Member
        • Apr 2007
        • 26

        #4
        Originally posted by Aswanth
        Round((Fields!C licks.Value*100 )/Sum(Fields!Clic ks_Show.Value, "DataSet1_Get_A ll_1234567"),2) & "%"
        One of the apparent issues that I see is the use of both aggregate and non-aggregate field in the same expression. I'm not sure how your report is grouped and designed (whether matrix or table) and hence won't be able to give you an exact solution. In all my reports whenever I've to do a percentage calculation I either use the aggregate values sum(fieldname) or add a calculated expression to the dataset itself and then drag & drop it on the report.

        As for the percentage values more than 100%, that's purely mathematical and possible. For example, if your clicks value is 200 & the clicks_show value is 100, what should be the percentage value? maybe I'm getting it wrong but your post doesn't say it clearly enough.

        Comment

        • deric
          New Member
          • Dec 2007
          • 92

          #5
          Originally posted by Aswanth
          No Clicks & Clicks_Show are Different..
          Clicks is One Column & Clicks_Show is Another Column..
          Yeah, obviously they are different columns, but what I'm trying to ask is whether they have the same values or not... because it is illogical to get the percentage of an amount with respect to a sum of another set of amounts. You might get a total of 100% of all your calculated percentages but most probably you'll get > or < 100%.

          Well, correct me if I'm wrong..

          You could consider doing it like this way:
          = (Clicks * 100) / Sum(Clicks)
          OR
          = (Clicks_Show * 100) / Sum(Clicks_Show )

          Comment

          • Aswanth
            New Member
            • Feb 2008
            • 14

            #6
            Originally posted by deric
            Yeah, obviously they are different columns, but what I'm trying to ask is whether they have the same values or not... because it is illogical to get the percentage of an amount with respect to a sum of another set of amounts. You might get a total of 100% of all your calculated percentages but most probably you'll get > or < 100%.

            Well, correct me if I'm wrong..

            You could consider doing it like this way:
            = (Clicks * 100) / Sum(Clicks)
            OR
            = (Clicks_Show * 100) / Sum(Clicks_Show )


            No they Don't Have Same Values.. They Are Different..
            Just Check Here..

            Clicks Values : 9000, 8000, 10000

            Clicks_Show Values : 8000, 6500, 11000

            The Percentages I'm getting : 35.29%, 31.37%, 39.22%

            The Total of these Percentages are >100.. But I want to show Total Calculation for 100%..

            Comment

            Working...