Summing up subgroup totals

In below table, the light blue rows, represents the subgroup I am trying to sum up.
The value in the "Inventory Value" contains the latest inventory value for said inventory.
Light green row is grouped by Store name, Light blue is grouped by inventory name. the expression in Inventory row for the inventory value column is  =First(Fields!InventoryValue.Value).
Doing a store summation, sums up all detailed values. For example in Store A, instead of 70K, the sum would be 130K... double summing the toy soldiers and cute dolls inventory. Is there a way to do the "correct" summation or a different approach to this? Thanks!
STORE
TOTAL STORE INVENTORY VALUE
INVENTORY
% OF STORE INVENTORY
INVENTORY VALUE
WARNING DATE
STORE A
1,000,000.00
TOY SOLDIERS
2.00%
20,000.00
20,000.00
11/5/2007
20,000.00
11/2/2007
PLUSH TOYS
1.00%
10,000.00
10,000.00
11/5/2007
CUTE DOLLS
4.00%
40,000.00
40,000.00
11/2/2007
40,000.00
10/31/2007
1,000,000.00
7.00%
70,000.00
STORE B
10,000,000.00
TOY SOLDIERS
0.20%
20,000.00
20,000.00
11/5/2007
20,000.00
11/2/2007
PLUSH TOYS
0.10%
10,000.00
10,000.00
11/5/2007
CUTE DOLLS
0.40%
40,000.00
40,000.00
11/2/2007
40,000.00
10/31/2007
10,000,000.00
0.70%
70,000.00

Tried the following approaches so far:
=Sum(ReportItems!InventoryValue.Value)
-- Errors out
=Sum(Fields!InventoryValue.Value,"dsSummary")
-- Created a new data set which only has the data from Light Green and Light Blue Rows (ommitted detailed rows)
Returns ungrouped sums, meaning the total sum for all stores for Inventory Value
=Sum(Fields!InventoryValue.Value)
-- Double sums inventory values (sums up the inventory values from the detailed history)

Similar Messages

  • I have a dynamic table that calculates the sum of all rows, no issue.  I'm struggling with pulling out a subtotal though.  I would like to have a check box in each row  that flags those rows and gives the sum of their total.  Any help would be greatly app

    I have a dynamic table that calculates the sum of all rows, no issue.  I'm struggling with pulling out a subtotal though.  I would like to have a check box in each row  that flags those rows and gives the sum of their total.  Any help would be greatly appreciated.

    Here's something I threw together rq. The script is in the change event for the checkbox in the table. (Of course, you'll have to modify it to suit the names of your fields.)
    var rows = xfa.resolveNodes("tblAmounts.Row1[*]");
    var subtotal=0;
    for (i=0; i<rows.length; i++) if (rows.item(i).cbAdd.rawValue == 1) subtotal = subtotal + rows.item(i).nfAmount.rawValue;
    nfSubtotal.rawVlaue=subtotal;

  • How do you get the percentage of one number compared to the sum of the total in an array in ipad numbers

    How do you get the percentage of one number compared to the sum of the total in an array in ipad numbers

    On the iPad my example looks like this:
    To fill the formula down you tap cell and then Fill:
    And drag the bottom part of the yellow rectangle down:
    Wayne's example would look similar.
    SG

  • SUM of the total in GroupBy

    This is query that I'm running to group the category
    SELECT cs.category as category,COUNT(*) AS total_cand
    FROM candidate_session cs
    WHERE cs.year = 2006
    and cs.month = 'November'
    and cs.category in ('DIPLOMA','RETAKE','CERTIFICATION')
    GROUP BY csd.category
    O/P
    Category Count
    DIPLOMA 100
    RETAKE 200
    CERTIFICATION 1100
    Is there any way that the count can be sum-ed to give the total (1400) in the same query.Thanks.

    Hi,
    I hope it will work for your requirement.
    SQL> ed
    Wrote file afiedt.buf
      1  WITH tmp_qry AS (
      2  SELECT 101 CodeNo, '01/01/07' dt, 'SALES' Particulars    , 500.00 CB  ,0.00 DB ,500.00 Balance
      3  SELECT 102, '02/01/07', 'SALES'     , 1500.00  ,0.00 ,2000.00 FROM  DUAL UNION ALL
      4  SELECT 103, '02/01/07', 'COMMISSION', 200.00   ,0.00 ,2200.00 FROM  DUAL UNION ALL
      5  SELECT 104, '03/01/07', 'SALES'     , 1000.00  ,0.00 ,3200.00 FROM  DUAL )
      6  SELECT DT,
      7         SUM(DECODE(Particulars,'SALES',CB_AMT,0)) SALES,
      8         SUM(DECODE(Particulars,'COMMISSION',CB_AMT,0)) COMMISSION,
      9         SUM(DECODE(Particulars,'TOTAL',CB_AMT,0)) TOTAL
    10  FROM (
    11       SELECT DT,NVL(Particulars,'TOTAL') Particulars,CB_AMT
    12       FROM (
    13              SELECT  dt,Particulars,SUM(CB) CB_AMT
    14              FROM tmp_qry
    15              GROUP BY ROLLUP(dt,Particulars)
    16            ) WHERE DT IS NOT NULL
    17* ) GROUP BY DT
    18  /
    DT            SALES COMMISSION      TOTAL
    01/01/07        500          0        500
    02/01/07       1500        200       1700
    03/01/07       1000          0       1000
    SQL> Regards
    Avinash

  • MDX How to get total distict count and SUM of subgroups?

    with
    MEMBER Measures.[EmailCount] as IIF(ISEMPTY([Measures].[Tran Count]), 0 ,[Measures].[Tran Count])
    MEMBER Measures.AdvGroupTotal as
    SUM (
    FILTER( EXISTING ([Dim IFA Details].[Parent Key].[Adviser Group].Members * [Dim Date].[Fiscal].[Fiscal Year].members )
    , Measures.[Amount] > 100 )
    , Measures.[Amount])
    MEMBER Measures.[AdvGrpCount] as
    distinctCOUNT(Existing([Dim IFA Details].[Parent Key].[Adviser Group].Members * [Dim Date].[Fiscal].[Fiscal Year].members))
    member Measures.IncomePerEmail as Measures.AdvGroupTotal /Measures.[EmailCount]
    member Measures.AvgIncomePerFirm as Measures.AdvGroupTotal/ Measures.AdvGrpCount
    SELECT { [Measures].[Amount] , Measures.[EmailCount], Measures.AdvGroupTotal, Measures.[AdvGrpCount],
    Measures.IncomePerEmail, Measures.AvgIncomePerFirm }
    ON COLUMNS,
    [Dim Date].[Fiscal Year].[Fiscal Year].ALLMEMBERS * [Dim Date].[Fiscal Quarter].[Fiscal Quarter].ALLMEMBERS *
    Except( [Dim Income Range].[Hierarchy].[Range ID].Members , [Dim Income Range].[Hierarchy].[All].UNKNOWNMEMBER.UNKNOWNMEMBER )
    on rows
    FROM [Income and Emails Cube]
    where
    [Dim Date].[Fiscal].[Fiscal Year].&[FY 13/14]
    The query above returns :
    How can I get Totals for AdvGroupTotal and AdvGroupCount for the year ?
    In the above case I want to tally up 1586 + 67 + 155 + 12 + 1718 for AdvGroupCount, same applies for the corresponding
    AdvGroupTotal figures.
    Seems simple enough, but I seem unable to come up with a way around this.
    Jon

    I worked it out with the help of Simon from another forum.
    Using a filtered set will get me the result required. It is however not very quick, so I probably should look into building it into the cube.
    WITH SET [Filtered Groups] AS
    ( Filter (
    { [Dim IFA Details].[Parent Key].[Adviser Group] } *
    { [Dim Date].[Fiscal Year].CurrentMember },
    [Measures].[Amount] > 100
    MEMBER [Measures].[Annual] AS
    Sum ( [Filtered Groups], Measures.[Amount] )
    MEMBER [Measures].[Firm Count] AS
    DistinctCount ( [Filtered Groups] )
    MEMBER [Measures].[Avg Income Per Firm] AS
    [Measures].[Annual] / [Measures].[Firm Count]
    MEMBER [Measures].[Test] AS
    Sum (
    { [Dim Date].[Fiscal Quarter].[Fiscal Quarter] } * { [Dim Income Range].[Hierarchy].[Range ID] } * { [Filtered Groups] },
    [Measures].[Amount]
    MEMBER [Measures].[TotalCount] AS
    DistinctCount (
    { [Dim Income Range].[Hierarchy].[Range ID] } * { [Filtered Groups] }
    MEMBER [Measures].[TotalAvg] as [Measures].[Test]/ [Measures].[TotalCount]
    MEMBER [Measures].[Quarter] as [Measures].[Amount]
    SELECT
    { [Measures].[Quarter], [Measures].[Annual], [Measures].[Firm Count], [Measures].[Avg Income Per Firm],
    [Measures].[Test], [Measures].[TotalCount], [Measures].[TotalAvg] } ON COLUMNS,
    [Dim Date].[Fiscal Year].[Fiscal Year].AllMembers * [Dim Date].[Fiscal Quarter].[Fiscal Quarter].AllMembers *
    Except ( [Dim Income Range].[Hierarchy].[Range ID].Members, [Dim Income Range].[Hierarchy].[All].UnknownMember.UnknownMember )
    DIMENSION PROPERTIES Member_Unique_Name, MEMBER_CAPTION
    ON ROWS
    FROM [Income and Emails Cube]
    WHERE [Dim Date].[Fiscal].[Fiscal Year].&[FY 13/14]

  • Groups Based On SubGroup Totals

    I'm wondering, without doing a subreport, if you can have Groups that are based on values within subgroups.
    For example:
    g:  Warehouse A
    d:     Item #
    subtotal:  Count of Item # for Warehouse A
    g:  Warehouse B
    d:     Item #
    subtotal:  Count of Item # for Warehouse B
    I want to be able to Group the Warehouses by the SubTotal values.
    For Example:
    g:  001-050 Items
    g:  051-100 Items
    Easy to do the formula logic for the If/Then/Else, but I can't see a way to implement in the report.
    Thanks.

    You can do this by using a correlated sub query in a SQL Command.
    Something like this...
    SELECT
    outerq.WarehouseName,
         (SELECT COUNT(ItemID)
          FROM tblInventory AS subq
          WHERE subq.ItemID = outerq.ItemID
          AND subq.WarehouseName = outerq.WarehouseName) AS ItemCount
    FROM tblInventory AS outerq
    ORDER BY outerq.WarehouseName, ItemCount
    This will allow the total item count to be included with the data set as it's returned from the database, before any grouping is done in CR. From there you can include the "ItemCount" field in your groups or group sorts.
    HTH,
    Jason

  • Sum() function not working properly. Instead of summing, its showing total count of the rows

    We have migrated one application from .net framework 1.0 to .net framework  2 (from Visual studio 2003 to Visual STUDIO 2005). Now after migration we are facing some problem related to the sum function in Crystal report 10. It is not working properly.
    So we migrated to Crystal report XI release 2 (though still using evaluation version for testing purpose), the problem is not yet resolved.
    The problem we are facing is while using the summary in the group field, it is showing the number of rows instead of the sum of the values.
    We have checked the same with min-max functions, and it is working properly with those.
    We have tried to make the sum by formula field. In such case, it is not showing any syntactical error but at execution time, it is throwing an error saying "A number field or currency amount field is required here".
    In the  the report the datatype of the field on which we are applying the sum function, is number, and in the table from where the data is fetched, the datatype is numeric(9,6).
    Any idea why sum function is not working ?
    I was browsing the net and saw running totals can be a work around for such summation issues in Crystal Report XI.
    Can you please provide insight of how to implement running totals for summation purpose in solving such issues.

    Hi,
    Running totals are more accurate than Summary Totals in Crystal.  Why? ...ask Crystal.  Anyway, just right click on Running Totals, create a new one, and enter you fields, etc. For group totals, it gives you a place to reset the totals for each group, etc.  Pretty self explainatory. 
    Jim

  • Make one warehouse stock qtys not sum in stock totals.

    Hi all,
    I have one warehouse , 01, that is damaged goods. I want to be able to add items to a sales order to sell it
    cheaper to certain customers, but I do not want it summing in my stock totals.  Is this possible?
    Deborah

    hI,
    I guess, Drop ship can be put to use.
    Please try it in demo DB
    Drop Ship Select this option to define the warehouse as a drop ship warehouse. Use when the company does not manage inventory, but receives commission for every order.
    This is under
    Administration   -
    >   SetUp   -
    > Inventory
    thanking you
    Malhaar

  • Validate two sums and display total

    I have a form which sums numeric data (amounts) in both columns and rows. I need to verify that the sum of the row of totals and the sum of the column of weekly totals are identical and dsiplay the total in a single grand total field. Because the form was imported as a fixed field form Tables and Subforms are not available. I've set up individual fields for AllTotals and the WeeksTotal elsewhere on the form that I can make invisible thinking I could use an if expression but I can't figure out how to display the sum in the GrandTotal field. Any suggestions?

    Can you put a new Text Field on top of the area where the GrandTotal would appear? Kinda like putting a transparent film over the top of a picture and writing on that? (Or a new layer on top of an existing picture.)
    That's how we handle text field "hints" on our forms. There's a Text Field, and on top of that I put a Text Box. When the user enters that field, I make the box hidden.
    Would something like that work?

  • I am looking to see if anyone has found out how to do a sum or percentage totalling other columns or rows in Numbers?

    I am looking to see if anyone has figured out, from their iPad in Numbers how to calculate percentages or sums totalling other columns or rows?

    The issue is I bought the G4 from my buddy a few months ago... the machine has been abused to say the least, both inside and out. It is almost falling apart and has a BUNCH of programs loaded on it. I have always used a PC and am still familiarizing myself with Macs, I need to clean out the machine and dump all the excess applications and files that are causing problems.
    I think this is why I am having some trouble. Sometimes it works just fine, but I am only working with a few simultaneous tracks at a time. I am using the virtual instruments at this time but will be running guitars and bass through an external sound card soon. Similar to what you are doing it sounds like.
    Anyway, wanted to give you some more insight. Last night it seemed to work alright, I am not going to rush into buying anything until I absolutely have to but want to get some direction as far as what I should be looking at.
    Any further input is appreciated, thanks.

  • Running Sum on column total minus current month

    Hi all,
    Is it possible to get the running sum total value of all the months minus the current month value in the column function,as I need to display the same in the narrative view.
    Like RSUM(YTD(M-1)Value)...
    Presently this RSUM is not giving me the right value.
    I can also do the total for all the months minus the current month value.Can it be done at the column funtion?
    Regards
    Ashish

    Hi
    Can you elaborate a little..Did you mean I need to create one variable in the repository?
    YTD (M-1 Value) / (YTD Last Year M 0 Value)
    where M0 is current month and M-1 is previous month and value is a measure.
    Regards
    Ashish
    Edited by: Ashish21473 on Jan 7, 2011 3:38 AM

  • Single Bottom row Sum of running total

    That's a terrible title.  LOL  Sorry.  Here's what I am doing in Numbers '08---I am setting up my budget, and I have several small tables for my various categories like Mortgage or Grocery.  In each small table, I have a very simple structure of a Date Column, an Expense Column and a Deposit Column and a Running Total.
    Mortgage Da
    Expense
    Deposit
    Running Tot
    $0
    Jan 1, 2014
    $1,770.19
    $1,770.19
    Jan 7, 2014
    $1,770.19
    $0.00
    Jan 23, 2014
    $885.09
    $885.09
    Sorry its not pretty.  OK, SO, WHAT I WANT is to be able to have a single cell at the bottom of the chart that constantly shows the last running total amount.  When I make a new expense or deposit, that $885.09 will go up or down and be shown on the next row.  BUT, I want to be able to have that next running total still shown in one lower, bottom row sum total.
    What I am trying to do with that is then have a general check book budget list of the main categories.  I want to take the bottom row sum total for Mortgage or Internet or Grocery and the other tables into one single list.   That list of categories would constantly stay current based on the information I put into the different tables.  In that master list, what is there allows me to see a global look at my budget, and (hopefully) should match my checkbook.
    Any ideas?

    Hi Carl,
    WHAT I WANT is to be able to have a single cell at the bottom of the chart that constantly shows the last running total amount. 
    Is something like this what you mean?
    Row 1 is a Header Row.  Row 8 is a Footer Row. The formula in D8 is:
              =INDEX(D,COUNTA(D)+1,1)
    It counts the number of non-blank cells in column D and uses that count to retrieve the value in the last cell in that column that is not blank.
    SG

  • Help in Total sum query

    Hello, How I can sum(code1). Every code1 has a group and every group's total (total_per) should be 100. I want to add the comments column in the result as well. Thanks.
    create table #Cumulate (code numeric (10), code1 numeric (10), total_per numeric(10),code_desc char(20))
    insert into #Cumulate values (1,121,10,'DHJ')
    insert into #Cumulate values (2,121,90,'DHJ')
    insert into #Cumulate values (3,121,10,'DHJ')
    insert into #Cumulate values (4,122,10,'CRT')
    insert into #Cumulate values (5,122,80,'CRT')
    insert into #Cumulate values (6,122,05,'CRT')
    insert into #Cumulate values (7,122,10,'CRT')
    insert into #Cumulate values (8,123,10,'DRT')
    insert into #Cumulate values (9,123,60,'DRT')
    insert into #Cumulate values (10,123,10,'DRT')
    insert into #Cumulate values (11,123,10,'DRT')
    insert into #Cumulate values (12,123,10,'DRT')
    insert into #Cumulate values (13,124,20,'DRT')
    insert into #Cumulate values (14,124,60,'DRT')
    insert into #Cumulate values (15,124,10,'DRT')
    insert into #Cumulate values (16,124,10,'DRT')
    insert into #Cumulate values (17,124,10,'DRT')
    --Results
    Code1 total_per Commments
    121   100         Total is 100
    122   105         Total is not 100
    123   100         Total is 100
    124   110        Total is not 100

    Try the below:
    Select Code1, Sum(Total_per) total_per, 'Total is '+Case when Sum(Total_per)=100 then '' else ' not' end+'100' Comments
    From
    #Cumulate
    Group by Code1
    However, I would suggest you to do the comment session at presentation layer, which would be a good for performance.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
     [Blog]

  • Different units in total sum row

    Hello Bex Experts,
    I have orders with different Units in a report. currently the total sum row show * for Mix
    How can I get the total sum for ST and KG like
    Total Sum 366 KG
    Total Sum 342 ST
    BR Matthias

    Hi Matthias,
    If you want to sum their numbers regardless of the UNITS, just use the NODIM() in formula..But if you need to add them and have 1 unit for the result, you must convert one of the them to another unit..
    Regards,
    Loed

  • OBIEE11g Grand total not summing up correctly

    hi all,
    I have to display the grand total from the foll calculation : (total po numbers - total Recd on time PO numbers) / total PO numbers.
    To get the total PO numbers - in the Edit formula - COUNT(PO numbers) and aggregation rule is set to SUM - this gives total correctly. eg : count of Total PO numbers - 15
    To get the total Recd on time PO numbers-- In the edit formula fields - COUNT(Recd on time PO numbers) and aggregation rule is set to SUM . This also shows hte total correctly. Eg : Count of total Recd on time PO numbers 12
    Now I do the division (Recd on time PO numbers/ total PO numbers ) Again in the Edit formula field SUM( COUNT(PO numbers))/ SUM(COUNT(Recd on time PO numbers)) - This gives incorrect results. output is 12.
    12/15 should be .8 but it shows 12.
    I am not sure why its not doing the calculation correctly.
    Is there any way I can achieve this ?
    Thanks
    OBI_user

    * 1.00 => http://gerardnico.com/wiki/dat/obiee/int

Maybe you are looking for