Sum formula for tables

I have made the switch from MS to MAC and word to pages and so far am as happy as can be!
Then, I go to add a sum formula to a list of numbers in a table column so that I can have a total at the bottom of the column.....AND, I can't find a way to do this in pages.
I've searched this forum but can't find anything, so I am sure it is me and not pages that has the problem. Surely pages wouldn't leave out the ability to sum a column of numbers?

A table is not a spreadsheet &, currently, iWork does not have a spreadsheet application. I do believe CalcService by Devon Technologies can do some basic calculations in a spreadsheet.

Similar Messages

  • How can I sum up raws? the sum function seems to work for columns only and right now I have to create a separate formula for each raw

    How can I sum up raws? the Sum function seems to work only on columns. Right now I have to create a separate formula for each raw

    Hi dah,
    "Thanks, but can I do one formula for all present and future raws? as raws are being added, I have to do the sum function again and again"
    You do need a separate formula for each group of values to be summed.
    If the values are in columns, you need a copy of the formula for each column.
    If the values are in rows, you need a copy of the formula for for each row.
    If you set up your formulas as SGIII did in his example (shown below), where every non-header row has the same formula, Numbers will automtically add the formula to new rows as you add them.
    "Same formula" in this context means exactly the same as all the formulas above, with one exception: the row reference in each formula is incremented (by Numbers) to match the row containing the formula.
    Here the formula looks like this in the three rows shown.
    B2: =SUM(2)
    B3: =SUM(3)
    B4: =SUM(4)
    That pattern will continue as rows are added to the table.
    Also, because the row token (2) references all of the non-header cells in row 2, the formula will automatically include new columns as they are added to the table.
    Regards,
    Barry

  • What formula for finding sum of Time from cells in a row?

    Is there a template on Numbers or a simple Sum formula that i can use to add hours and minutes worked so that a cell will show total number of hours and minutes worked in a day? Thanks.

    In its bare form, the required formula would be :
    =(timeOut1-timeIn1)+(timeOut2-timeIn2)+(timeOut…-timeIn…)
    this said, you must understand that Numbers has no time items.
    It has date_time ones and, if it's Numbers '09, it has duration ones.
    A cell whose format is defined to display only a time value contains always a date component.
    Near the safari window in which I am writing is a Numbers document.
    If I type 13:58:20 in cell B2, the app starts displaying 13:58 because the contents parser which is in Automatic mode recognized that my entry was resembling to a time one. So it « decided » to display only the hours and minutes of the time component.
    If I enter the Cells Inspector and define the format to date time displaying the date and the time (with seconds), I get: 2012-04-12 13:58:20
    If the process whose start was just typed is supposed to end at 18:26, I may repeat the already described process to C2 but as quite everybody knows in this Discussions forum, I'm lazy.
    So, I select every cells supposed to receive a time value and define, temporarily, their format to date_time displaying date, time with seconds. This way I will not have to repeat that for every entry.
    In C2, I type 18:26.
    The app displays : 2012-04-12 18:26:00
    Leaving space for two other tasks, in H2, I type =C2-B2
    As I am running Numbers '09, I get 4h 27m 40s which is a duration value.
    Now, we will assume that the start time remains unchanged but that the task will end tomorrow at 5:55
    If I type this value immediately in C2, the cell will contain 2012-04-12 05:55:00 and H2 will contain -8h 3m 20s which is certainly not what you want to get.
    If I wait tomorrow before typing this end time in C2, the cell will contain 2012-04-13 05:55:00 and H2 will display the wanted value : 15h 56m 40s.
    CAUTION : the application made no error, it just did exactly what I wanted it to achieve.
    Third case, I decide to type the start and the end time when the task isfinished, say on 2012-04-14,
    B2 will contain : 2012-04-14 18:26:00
    C2 will contain : 2012-04-14 05:55:00
    and one more time we will get the infamous -8h 3m 20s which is certainly not what you want to get.
    So, it's clear that a more sophisticated formula is required.
    Here I will describe the one which I use. I guess that other helpers will describe other ones. It's the rule of the game.
    I use the function TIMEVALUE.
    =(TIMEVALUE(C2)-TIMEVALUE(B2)+IF(TIMEVALUE(C2)>TIMEVALUE(B2),0,1))*24
    which will return the durations expressed in decimal hours.
    This formula is OK as long as the task duration isn’t longer than 24 hours.
    If a task duration may be greater than 24 hours, the best scheme would be to enter full date_time values.
    For several tasks, the formula would be :
    =(TIMEVALUE(C2)-TIMEVALUE(B2)+IF(TIMEVALUE(C2)>TIMEVALUE(B2),0,1)+TIMEVALUE(E2)- TIMEVALUE(D2)+IF(TIMEVALUE(E2)>TIMEVALUE(D2),0,1)+TIMEVALUE(G2)-TIMEVALUE(F2)+IF (TIMEVALUE(G2)>TIMEVALUE(F2),0,1))*24
    Yvan KOENIG (VALLAURIS, France) jeudi 12 avril 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • How to create a running total formula for different calendar years

    Hello everyone,
    I am looking for some help in creating a running total formula for different calendar years in Oracle. This is what I currently have organized in the crosstab report: vertically I have the cities from our database organized, then horizontially have the following information for each city:
    2006 /2007 /2008
    Amount /Amount Spent /Unspent Amount Amount Recieved/Amount Spent /Unspent Amount Amount Recieved/Amount Spent/Unspent Amount
    Recieved
    I am trying to create a formula that will specify each calendar year. For example, I'd like to have a formula in 2007 which would total the: 2007= {2006 unspent amount + the unspent amount in 2007} and same for 2008= {2007 unspent amount + the unspent amount in 2008}. I hope this is clear, I have simplified the report into a basic interpretation of what i've been trying to accomplish.
    Would anybody know if this is possible and how to approach this?
    Really appreciate it! Thanks.
    Alex

    Hi,
    you can try and define a running total as a calculation in the crosstab as:
    sum(Unspent Amount) over (partition by city order by year)
    i find the crosstab format comfusing sometime since the aggregation is auto applied.
    I would start with a flat table and then "duplicate is as a cross tab"
    for your running total you can sort the data by the city,year and get it to 3 lines for each city, for example:
    city year Unspent Amount all other amount...
    X 2007 10
    X 2008 20
    X 2009 30
    Y 2007 5
    Y 2008 15
    Y 2009 25
    then you can use a funtion to calculate the amount :
    sum(Unspent Amount) over (partition by city order by year)
    this is the sql i used just to check it:
    SELECT city,year,"Unspent Amount"
    ,SUM("Unspent Amount") over (PARTITION BY city ORDER BY YEAR)
    FROM (
    SELECT 'X' city, 2007 YEAR, 10 "Unspent Amount" FROM dual UNION ALL
    SELECT 'X', 2008 ,20 FROM dual UNION ALL
    SELECT 'X', 2009 , 30 FROM dual UNION ALL
    SELECT 'Y', 2007 , 5 FROM dual UNION ALL
    SELECT 'Y', 2008 , 15 FROM dual UNION ALL
    SELECT 'Y', 2009 , 25 FROM dual
    Tamir

  • Sum formula doesn't change when add row

    This question is about Numbers.  I have a column of numbers with a sum cell at the bottom of the column.  Sometimes I need to insert a row at the very bottom of the column, just above the cell with the Sum formula.  I then need to tweak the sum formula to include that added row; however, if I add a row in the middle of the column, the sum formula automatically changes to include that added row. 

    Hi c,
    Numbers will automatically adjust the formula if all body cells above the added cell have the same formula, or if the added cell is within the range specified in the formula.
    In the middle of the column, the second is true. At the end of the column, the added cell is outside the range specifired in your formula, and there is at least one regular cell above that does not contain the same formula.
    Use one or more header rows at the top of the table for your labels. Use a Footer row to hold the SUM formula. Place the SUM formula in the Footer row, using =SUM(B) for example to SUM the values in all of the body cells in column B.
    Regards,
    Barry

  • USING SUM IN INTERNAL TABLE

    plz give me a simple example for using SUM in internal table and do some calculations in the same internal table.

    HI
    CHECK WITH THIS
    Syntax
    SUM.
    Effect
    The statement SUM can only be specified within a loop starting with LOOP, and is only considered within a AT- ENDAT control structure. Prerequisites for using the statement SUM include using the addition INTO in the LOOP statement, and that the specified work area wa is compatible with the row type of the internal table. In addition, SUM cannot be used when the row type of the internal table itab contains components that are tables.
    The statement SUM calculates the component total with the numeric data type (i, p, f) of all rows in the current control level and assigns these to the components of the work area wa. In the control levels FIRST, LAST, and outside of an AT-ENDAT control structure, the system calculates the sum of numeric components of all rows in the internal table.
    Example
    Control level processing for creating a list. At the end of line groups, the total of reserved places is calculated and issued.
    DATA: sflight_tab TYPE SORTED TABLE OF sflight
                      WITH UNIQUE KEY carrid connid fldate,
          sflight_wa  LIKE LINE OF sflight_tab.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab.
    LOOP AT sflight_tab INTO sflight_wa.
      AT NEW connid.
        WRITE: / sflight_wa-carrid,
                 sflight_wa-connid.
        ULINE.
      ENDAT.
      WRITE: / sflight_wa-fldate,
               sflight_wa-seatsocc.
      AT END OF connid.
        SUM.
        ULINE.
        WRITE: / 'Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        SKIP.
      ENDAT.
      AT END OF carrid.
        SUM.
        ULINE.
        WRITE: / 'Carrier Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        NEW-PAGE.
      ENDAT.
      AT LAST.
        SUM.
        WRITE: / 'Overall Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
      ENDAT.
    ENDLOOP.
    Hope this solves ur problem....
    <b>do reward if useful....</b>
    regards
    dinesh

  • Error in Fast Formula for Supplemental Earnings Elements

    Hi,
    I have an requirement in Supplement Earning Elements for US Localization. I need to define some Supplement Earning Elements that should comes in Payroll with the extension of existing Elements.
    Here are the Steps for setups which i have done so far-
    Step 1:Created new Elements with their values with effective dates for existing user Table name
    Step 2:Done the setup for New Elements with classification as Supplemental and Category also attached the formula like "FLAT AMOUNT" formula for Calculation rule in Element Earning screen.
    Step 3: when i tried to query for the element i have created, the value in Calculation Field is "Elementname_FLAT_AMOUNT_RWSI" which is not same for the existing elements.Existing Element which is of same classification and same category the Calculation rule field is "ElementName_FLAT_AMOUNT".
    Step 4: After that i did setup for Element Description and Element Link.
    Step 5: Then i have copied the Formula from Existing element(which is previously configured and working fine for the existing elements ), made the modifications for the newly created element. When Compiling the formula ,i am getting an Error "Incorrect Data type"
    I have two queries -
    1- The setup in Earnings Screen with Calculation Rule is correct or not. As the Calculation Field for newly elements and the existing elements are different (as mentioned in Step 3).
    2- Compilation Error "Incorrect Data Types" in Fast Formula.(as mentioned in Step 5).
    I m pasting the Fast Formula code here for ready reference
    Default for TERMINATED_EMPLOYEE      is 'N'
    Default for RUN_TYPE               is 'R'
    Default for FINAL_PAY_PROCESSED      is 'N'
    default for PAYROLL_TERMINATION_TYPE is 'L'
    default for BG_TERMINATION_TYPE is 'L'
    default FOR LAST_STANDARD_PROCESS_DATE_PROCESSED IS 'N'
    DEFAULT FOR ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD     IS 0
    DEFAULT FOR ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD     IS 0
    DEFAULT FOR ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD     IS 0
    DEFAULT FOR ELEMENT_NAME_ASG_GRE_YTD IS 0
    DEFAULT FOR ELEMENT_NAME_ASG_GRE_RUN IS 0
    Default for PAY_EARNED_START_DATE is '02-JAN-0001' (DATE)
    Default for PAY_EARNED_END_DATE is '02-JAN-0001' (DATE)
    Default for ASG_NUMBER is ' '
    Default for ELEMENT_NAME_ASG_GRE_FYTD IS '0'
    Default for CURRENT_ELEMENT_TYPE_ID is 0
    Default for GROUP_KF_PAY_FREQUENCY is '0'
    DEFAULT FOR Amount IS 0
    INPUTS ARE Amount
    IF ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD WAS DEFAULTED OR ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD = 0 THEN
    pay_frequency = GROUP_KF_PAY_FREQUENCY
    ELEMENT_TYPE_ID_PASSED = CURRENT_ELEMENT_TYPE_ID
    annual_rate = HCS_GET_SUPPLEMENT_RATE(ELEMENT_TYPE_ID_PASSED, PAY_EARNED_END_DATE, 'General Rate')
    annual_bal = ELEMENT_NAME_ASG_GRE_FYTD
    IF annual_bal = annual_rate THEN
    Amount = 0.00
    mesg = 'Contract amount '||TO_CHAR(annual_rate)||' fully paid for '||ASG_NUMBER
    ELSE
    Amount = annual_rate / TO_NUMBER(pay_frequency)
    If abs(annual_bal+amount-annual_rate) < 1 then
    Amount = annual_rate-annual_bal
    IF ELEMENT_NAME_ASG_GRE_RUN=0 THEN
    flat_amount = Amount
    + ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD
    + ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    ELSE
    ( flat_amount = Amount )
    ELSE
    (flat_amount = ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD + ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD
    + ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    clear_repl_amt = -1 * ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD
    IF ELEMENT_NAME_ASG_GRE_RUN = 0 THEN
    IF ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD <> 0 THEN
    clear_addl_amt = -1 * ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD
    IF flat_amount < 0 THEN
    (IF (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND
    FINAL_PAY_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND
    FINAL_PAY_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'L' AND
    TERMINATED_EMPLOYEE = 'Y' AND
    LAST_STANDARD_PROCESS_DATE_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE = 'L' And
    TERMINATED_EMPLOYEE = 'Y' AND
    LAST_STANDARD_PROCESS_DATE_PROCESSED = 'N') THEN
    neg_earn = -1 * ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    ELSEHuman Resource Management (HRMS)
    (neg_earn = flat_amount - ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    flat_amount = 0
    ELSE
    (IF ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD <> 0 THEN
    neg_earn = -1 * ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    IF (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'N') OR
    ( PAYROLL_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'Y'
    AND RUN_TYPE != 'R') OR
    ( PAYROLL_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'Y' AND
    RUN_TYPE != 'R') THEN
    (STOP_ENTRY = 'Y'
    mesg = ' ELEMENT_NAME earning has been stopped for this assignment.'
    ln_calc_meth = SET_ALTRNT_FLAT_RATE_CALC_METH('NOT_APPLICABLE','NOT_APPLICABLE')
    if (1 = 1) then (
         soe_run = ELEMENT_NAME_ASG_GRE_RUN
         soe_ytd = ELEMENT_NAME_ASG_GRE_YTD
    RETURN flat_amount, clear_addl_amt, clear_repl_amt, neg_earn, STOP_ENTRY, mesg
    Can anyone help me in solving this problem. Any kind of pointers would be helpful.
    Thanks
    Pradeep.

    Hi Pradeep,
    Hope you created the new element using the 'Earnings Template' form. If it is created using the 'Earnings Template' form then the calculation rule
    should be correct. You said you are modifying the new element formula by using the existing element formula code, have you checked if the
    formula code to the old and new once have changed anything other than the element name and standard input elements reference. Try to use
    the debug messages in formula and see if that give you any clue. You should find the document in metalink how to debug a formula.
    Thanks,
    Satin

  • Web Service Connection on fresh SUM formula is zero

    I am using Xcelsius SP1.  I have a field in the spreadsheet that has the formula "=SUM(H12:H16)".  I am using a Web Service Connection to refresh the data.  Following a refresh from the web service connection the field with the SUM formula is 0.  I have discovered that ff the values in SUM range (in my case H12:H16) are identical to the refrehsed data then the formulas results willl be 0.  If one of the sum values is different from the original values then the sum formula works.  Is this a bug? Is there a work around?

    I had a problem with the data format after getting number-values from my web-service, because every number-value I got was not a number - it was a string.
    so I had to convert all the data in Excel from string to number values. after that everything works fine for me.
    you could try that out....

  • Sum Distinct for a measure object

    Hi,
    Can anybody let me know how to go ahead and get a sum distinct for a particular measure object in a Universe?

    If your database supports the syntax, you can simply use SUM(DISTINCT table.measure_column) and it should apply the distinct function. Note, however, that this can result in under-reporting certain values. For example, assume you have two sales orders with the same amount: $100. As long as you include the order number (or primary key order_id or otherwise) you will get a total of $200. But if you remove order number, the sum(distinct) will see two equal values (both $100) and your total will only be $100 instead of the correct answer $200.
    What is the real problem you are trying to solve?

  • This entry already exists in following tables "tax formula master table'

    I am getting this error while adding a new tax Formula.
    Please suggest the possible solution.
    SAP B1 2007 B PL-10
    This entry already exists in following tables "tax formula master table' (OFML) (ODBC-2035) [Message134-183]
    Regards,
    Ranjith

    Hi
    First of all have u tried what i told ??
    For which tax going u r going to create???
    Check in another DB, whether same error is coming r not
    Giri
    Edited by: Giri dharan on Dec 30, 2009 5:47 PM

  • Needing to input formula for percentage

    It need to look like this...(obviously I can do this part), but I need to input the formula for the third column to automatically take off the 30% discount from each list price (they will all be different. Then, I need the last column to keep the running total for all discounted prices column. I am having trouble finding this in the helps, as alot of the info is similar to what I need, but I have not found one that actually shows how to just take the 30% off the list price. Thanks a bunch for any help.
    Title
    Author
    List Price
    30% Vendor Discount
    Running Total
    BlahBlah
    Blah
    19.99
    need formula for reducing 30% of list price
    This column needs to keep a running total of discounted price

    Hi gayle,
    The formula in the 30% discount column (D2) is simply:
    =C2*.3
    Fill this down.
    A running total of every number in column D would look like this:
    SUM(D$2:D2)
    fill this down.
    quinn

  • Formula for selection criteria

    Hello all.
    I have a questions regarding creating a selection formula and parameters.
    See attached picture. I have a table that houses all the data I need for my report .
    I want to create a report with the following selection parameters
    Monthly
    yearly
    quarterly.
    if the user selects monthly I want the report to return  the most recent 12 months
    if the user select yearly I want the report to return the last 5 years
    and if the user selects quarterly I want the report to return the last completed 10 quarters.
    Any idea how I can accomplish that?
    thanks in advance for your help.

    This is actually not that difficult.  Assuming that the parameter is named {?Time Period} you'll create a formula for start date.  I'm also assuming that you want to show up to the current date, not the end of the most recent complete time period and that you want to start on the first day of the period, not the day that corresponds to the current day and that quarters start on the first days of Jan, Apr, Jul, and Oct.  So, it will look something like this:
    {@StartDate}
    DateVar tmpDate;
    DateVar startDate;
    if {?Time Period} = 'Monthly' then
         tmpDate := DateAdd('m', -12, CurrentDate);
         startDate := Date(Year(tmpDate), Month(tmpDate), 1);
    else if {?Time Period} = 'Yearly' then
         tmpDate := DateAdd('y', -5, CurrentDate);
         startDate := Date(Year(tmpDate), 1, 1);
    else if {?Time Period} = 'Quarterly' then
      tmpDate := DateAdd('q', -10, CurrentDate);
      if Month(tmpDate) in [2, 5, 8, 11] then //the second month of the quarter
        tmpDate := DateAdd('m', -1, tmpDate);
      else if Month(tmpDate) in [3, 6, 9, 12] then //the third month of the quarter
        tmpDate: = DateAdd('m', -2, tmpDate);
      startDate := Date(Year(tmpDate), Month(tmpDate), 1);
    startDate
    You'll then go to the Select Expert and manually edit the selection formula to read something like this:
    {MyTable.DateField} >= {@StartDate} and
    {MyTable.DateField} <= CurrentDate
    -Dell

  • Sum formula not calculating sum accurately

    Hie All,
    In my Webi report, I've included a sum formula (Sum[actual hours]) for both rows and columns. However, the total is inaccurate for some rows/columns. Any idea why this could happen and how to resolve the issue? Thanks.

    Hi Jeewan,
    You can try these but i'm not sure it will work:
    1. Try merge dimension on common objects.
    2. Try sum(sum([actual hours]))
    3. Instead of using formula you can use the sum function available in "Analysis -> Function -> Σ Sum"
    4. It can be due to the projection used at universe level for this you have to access the universe and check.
    5. Try dragging some compatible objects in object browser it might happens some times that data will not come correctly.
    6. last one (hit and try) check the filters once.
    Hope this helps,
    Thanks,
    Shardendu Pandey

  • Formula for Net Entry Rate

    Dear SDN's,
    In my Net Entry Report i need to create a formula based on
    No. of emp. recruited u2013 Number of emp. Leaving divided by total HC (EOP)
    I want to make sure, the total HC will be the of the end of the previous month (e.g. - if the report is for April, so the total HC will be for the last day of March)
    Could you please send the suitable formula for the same ?
    Thanks and Kind Regards,
    Lakshman Kumar G

    In CMOD, you need to create Project Z***.
    I am sure sombody must have created before and the INCLUDE must be available for you to add code.
    WHEN 'ZVARIABLE'.
        IF i_step EQ 2.                              "Only post-input screen
          cal_mon  = sy-datum+4(2).
          cal_mon_yr = sy-datum+0(4).
          IF cal_mon = '01'.
            prev_mon = '12'.
            prev_mon_yr = cal_mon_yr - yr_minus.
          ELSE.
            prev_mon = cal_mon - mon_minus.
            prev_mon_yr = cal_mon_yr.
          ENDIF.
          w_e_t_range-sign = 'I'.
          w_e_t_range-opt  = 'EQ'.
          CONCATENATE prev_mon_yr prev_mon INTO w_e_t_range-low.
    Add the value range to the table
          APPEND w_e_t_range TO e_t_range.
        ENDIF.
    This code considers the year as well.  Improvise the code according to your requirement.
    Thanks.

  • Formula for calculating aggregate percentage and percenatge of gender

    hi all
    i have a sp from which i get result columns  gender,percentage,studentcount,year
    my sp is like this..
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[usp_GetState]') AND type in (N'P'))
    DROP PROCEDURE usp_GetState
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[usp_GetState]
    ( @ExamYear Smallint
    ,@ExamType Nvarchar(10)
    AS
    BEGIN
    SET NOCOUNT ON;
    WITH cte_Schools AS
    SELECT
    [Foreign]= CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
    ,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END StateName
    ,COUNT( DISTINCT M.SchoolCode) Schools
    ,SUM( M.Nos) Students
    FROM rptFinalResultSummaryMaster M
    LEFT OUTER JOIN State S ON M.StateCode=S.StateCode AND M.Zone=UPPER(LEFT(S.Zone,1))
    LEFT OUTER JOIN Country C ON S.CountryId= C.CountryId
    WHERE M.Year=@ExamYear AND M.CourseCode=@ExamType
    GROUP BY CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
    ,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END
    SELECT
    SlNo=ROW_NUMBER() OVER(PARTITION BY [Foreign] ORDER BY StateName)
    ,[Foreign] ,StateName, Schools, Students
    , Percentage = (Students/(SELECT SUM(Students)*1.000 FROM cte_Schools))*100
    FROM cte_Schools
    ORDER BY [Foreign],StateName
    END
    GO
    now..i wrote formula for percentage  and when i connected this sp to my rdl where i took tablixi gave percentage value to gender and total percentage column
                                           gender(column group)                      
    total
    number   percentage
    passcategory         
    this is my tablix format
    my output looks like
    boys     girls                                     
    total
    number(percentage)
    passcategory1  (percenatge)                        21 (40.38)          43 (56.75)          
           64(48.56)          
    passcategory2   (percenatge)                       11  (21.15)         10    (13.51)               31(17.33)
    passcategory3    (percentage)                       20 (38.46)         21    (28.37)               41(33.41)
    total                     (percentage)                     
    52(xxx)           74  (xxx)                     136   (100%)
    i'm not getting thegender percentage properly for girls and boys total percentage of boys and girls coming correctly but individual percentage is not properly coming...that's because in sp i gave calculation for only total percenatge ..how can i calculate
    the individual percentage of girls and boys in single column...so that i can place in gender column in tablix..and i can retrieve individual percentgaes of girls and boys seperately as shown in output..
    please reply..its urgent
    thanks in advance..
    lucky

    please reply..its urgent
    Here is a tip: if you want to tick off people from helping you, you should absolutely include "urgent" in your post. That's a good way to encourage people to move to the next post. I did see this one earlier today, but did not have the time.
    Anyway, I cannot really make out heads or tails of your question. Your output takes about gender, but I cannot see it in the output from the query, which appears to group by "Foreign" and StateName. How does the boys and girls get into the picture?
    And for that matter that "totals" column?
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Workflow Event is not triggering in Quality System

    Hello We developed workflow in DMS module for Status change of teh Change Number (Document NUmber) .It is working fine in dev system but not in Quality system . Please provide valuable adivse on the same

  • Using my new ipod touch as a PDA

    I received an Ipod touch 8GB for Christmas from my husband and I believe he intended for me to be able to use this as a replacement for my Windows Based PDA by Toshiba. I have used a Windows based PDA for many years and really need to have the abilit

  • Patch for modbin6-1.00.38.exe is out.. "2MBIOS.BIN can't open!" Solved.

    Hi mates, ive decide to make a patch for modbin6 1.00.38 to improve stability and minise risk of modding the BIOS. for users which is reading this post if never heard about MODBIN better avoid reading below. its nice program for basic BIOS mod, simpl

  • Weird proof reader issue - underlining words that shouldn't be?

    Hey everyone, I love Pages but I've been having a problem with it underlining words for being grammatically wrong when they're clearly not. Please see the attached image as an example. http://imgboot.com/images/arthomure/proofreader.jpg I get Macrole

  • Problem with BPM

    Hi, My BPM Scenarios are working earlier. Suddenly all the  scenarios are not working.All the messages are showing sceduled. My scenarios are IDOC-Webservice-IDOC  ( Asynch-scnch scenario) File-RFC-File ( Async-synch scenario) other scenarios other t