Summing a field if another field = scrap

I'm working on a SSRS report where I need to sum a field if another field=scrap. I have multiple fields with 2 parameters and a sum on 1 field already in this report. I have tried to make it work a couple of other ways(expressions and query) but have
had no luck. Any suggestions would be appreciated, since I'm new to sql and visual studio.
Shi Rumptz

I'm working on a report where I need to sum a field if another field=scrap.
Hello,
Did you want to get the sum value in the total row in the report? Which report did you designed?
If you are use SSRS report, you can try to use the following expression to get the specify value:
=SUM(IIF(Fields! product_code.value='scrap', Fields!desired_qty.value, 0.0),"Scope")
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support

Similar Messages

  • Sum after field change

    Does any one know how to sum a column upon the field change of another column?  For instance;  a construction estimate is dividedinto, say 50 divisions (categories). Each entry into my general ledger, a numbers spread sheet, has a column for, Job, and division.  To bill a job I would filter by job name, then sort the division column, accending.  I would then right click, and sum after field change.  In this way I would have the sum of each divisions costs to date, and compare it with the original estimate.  The new numbers update does not seem to have this feature, (sum after field change).  Does anyone know how to accomplish this, perhaps with sum if?

    Numbers seems to perform calculations when any dependencies are changed.  so entering a new number should cause a sum to update.
    try this as an experiment:
    in a small table make the last row a footer row then in footer of column A enter the formula:
    =sum(A)
    like this:
    now enter values in the column:

  • What is the difference between   nvl(sum (field), 0) & sum(nvl (field,0)) ?

    What is the difference between nvl(sum (field), 0) & sum(nvl (field,0)) ?
    For the below table data i don't see any different in results
    CREATE TABLE FRUITS
    TYPE VARCHAR2(10 BYTE),
    VARIETY VARCHAR2(10 BYTE),
    PRICE NUMBER(18,2)
    TYPE     VARIETY          PRICE
    apple     gala          2.79
    apple     fuji          0.24
    apple     limbertwig     2.87
    orange     valencia     3.59
    orange     navel          9.36
    pear     bradford     7.77
    pear     bartlett     7.77
    cherry     bing          2.55
    cherry     chelan          6.33
    pear     bradford     
         navel          6.39
    select variety, nvl(sum(price),0)
    from fruits
    group by variety;
    VARIETY     NVL(SUM(PRICE),0)
    limbertwig     2.87
    bartlett     7.77
    bing     2.55
    marathon     0
    gala     2.79
    fuji     0.24
    navel     15.75
    bradford     7.77
    chelan     6.33
    valencia     3.59
    select variety, sum(nvl(price,0))
    from fruits
    group by variety;
    VARIETY     SUM(NVL(PRICE,0))
    limbertwig     2.87
    bartlett     7.77
    bing     2.55
    marathon     0
    gala     2.79
    fuji     0.24
    navel     15.75
    bradford     7.77
    chelan     6.33
    valencia     3.59
    no difference in output.
    what is the difference?
    Thanks in advance

    Do you see the difference now?
    PRAZY@11gR1> create table testing(field number);
    Table created.
    Elapsed: 00:00:00.10
    PRAZY@11gR1> insert into testing select null from dual connect by level<=5;
    5 rows created.
    Elapsed: 00:00:00.00
    PRAZY@11gR1> select * from testing;
         FIELD
    Elapsed: 00:00:00.01
    PRAZY@11gR1> select sum(nvl(field,1)) from testing;
    SUM(NVL(FIELD,1))
                    5
    Elapsed: 00:00:00.00
    PRAZY@11gR1> select nvl(sum(field),1) from testing;
    NVL(SUM(FIELD),1)
                    1
    Elapsed: 00:00:00.00In the former, we are substituting 1 to null value and summing-up. hence we got 5. in the later, we are summing-up the null, which is null and substituting 1 if the result is null. so we got 1.
    Regards,
    Prazy

  • Trouble when attempting to Sum Calculated Field.

    I had to create a calculated field called RI_Limit which contains static data.  (Developers/DBA could not enter it into the database at this time, so this was a work around. 
    The calculated field is setup as such:
    =iif(Fields!Location_LOCATION_NAME.Value = "a", 8, iif(Fields!Location_LOCATION_NAME.Value = "b",2, iif(Fields!Location_LOCATION_NAME.Value = "c",0, iif(Fields!Location_LOCATION_NAME.Value = "d",0, iif(Fields!Location_LOCATION_NAME.Value = "e",1, iif(Fields!Location_LOCATION_NAME.Value = "f",1, iif(Fields!Location_LOCATION_NAME.Value = "g ",0, iif(Fields!Location_LOCATION_NAME.Value = "h",0,iif(Fields!Location_LOCATION_NAME.Value = "i",4,iif(Fields!Location_LOCATION_NAME.Value = "j A",0,iif(Fields!Location_LOCATION_NAME.Value = "k",0,iif(Fields!Location_LOCATION_NAME.Value = "l",7,iif(Fields!Location_LOCATION_NAME.Value = "m",0,iif(Fields!Location_LOCATION_NAME.Value = "n", 1, iif(Fields!Location_LOCATION_NAME.Value = "o",0, iif(Fields!Location_LOCATION_NAME.Value = "p",1, iif(Fields!Location_LOCATION_NAME.Value = "q",3, iif(Fields!Location_LOCATION_NAME.Value = "r",1, iif(Fields!Location_LOCATION_NAME.Value = "s",1, iif(Fields!Location_LOCATION_NAME.Value = "t",3, iif(Fields!Location_LOCATION_NAME.Value = "u",5,iif(Fields!Location_LOCATION_NAME.Value = "v",0,iif(Fields!Location_LOCATION_NAME.Value = "w",0,"NA")))))))))))))))))))))))
    and I setup a textbox with that expression and the numbers fill in correctly with its cooresponding site name.
    However, when I go to sub total or total, I get a much larger number than expected. (See screenshot)
    I have searched the internet on a way to calculate both the total by Location Level 2 and LOB total, but nothing that pertains to the specific issue where by calculated field contains static data.  Nothing I try produces an accurate sum.  Any suggestions?

    Hi Katherine,
    Sorry for taking a few days to reply.
    I tried the suggestion, but it it still not summing my calculated fields.  The total row will calculate my other cells okay but not the calculated fields that I had to add to the report.  When I attempted to write an expression to sum the calculated
    fields I get the following error message. 
    The expression used for the calculated field '=sum(iif(Fields!Location_LOCATION_NAME.Value = "test", 8, iif(Fields!Location_LOCATION_NAME.Value = "test1",2, iif(Fields!Location_LOCATION_NAME.Value = "test2",0, iif(Fields!Location_LOCATION_NAME.Value = "test3",0, iif(Fields!Location_LOCATION_NAME.Value = "test4",1, iif(Fields!Location_LOCATION_NAME.Value = "test5",1, iif(Fields!Location_LOCATION_NAME.Value = "test6 ",0, Fields!Location_LOCATION_NAME.Value = "test7",0,Fields!Location_LOCATION_NAME.Value = "test8",4,Fields!Location_LOCATION_NAME.Value = "test9",0,Fields!Location_LOCATION_NAME.Value = "test10",0,Fields!Location_LOCATION_NAME.Value = "test11",7,Fields!Location_LOCATION_NAME.Value = "test12",0,Fields!))' includes an aggregate, RowNumber, RunningValue, Previous or lookup function. Aggregate, RowNumber, RunningValue, Previous and lookup functions cannot be used in calculated field expressions.
    The Espression for the calculated field I am attempting to sum is the following:

  • How to sum a field in smartform

    hi experts,
    i m new to smartform. i made a smartform in which i get the output in a tabular form......
    i want to sum a field. how can i get the sum in the footer?

    Hi
    Welcome to SDN forum
    see this and doa ccordingly
    Subtotals - Check the link...
    Re: Subtotal with Table Node in smartforms
    You can use the PROGRAM LINES node to calculate the page totals in Table node.
    Table Node has three sections:
    Header: (Triggered once in the beginning of a page)
    Create a Program lines node to reset the value of TOTAL to 0.
    Main Area (For each row of internal table)
    Create a Program lines node to add the Value to TOTAL
    Footer (Triggered once in the End of a page)
    Display the TOTAL
    Note: 1) You can declare the TOTAL variable in the GLOBAL Definitions under GLOBAL DATA.
    2) In the PROGRAM lines always pass the TOTAL in both INPUT and OUTPUT parameters
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Sum calculated field in report

    Hi, I have a report that groups by employee then by machine. In this report I sum several fields, but need to sum a calculated field and can't figure it out. This is the calculation:
    <?( QTY_MOVED) div ( TIME +.001 ) div ( INVERSE + .001)?>
    This is a total field using a field that works fine.
    <?sum(current-group()/QTY_REJ)?>
    How do I incorporate the calculation in the <?sum(current-group()/.............I get errors if I just put in the calculation above.
    thanks!

    Thank you for your help. After taking your advice and getting it to work by messing around with the brackets, management has changed their mind on the calc. Now they want me to use this calculation:
    SELECT EMPLOYEE, SUM(QTY_MOVED), SUM(QTY_REJ), SUM(TIME), (nvl([b]sum(QTY_MOVED),0)/nvl(sum(TIME),0))/nvl(sum(INVERSE),0) eff ,'DIRECT'
    FROM VW_TIMETRACK
    WHERE START_DATE >= :BEGIN
    AND START_DATE <= :END
    AND WORK_ORDER <> ' '
    GROUP BY EMPLOYEE
    to get the average. Now the weird thing is, I can get the value in toad, and I can get it to output in raw xml data, but when I try to add the eff field right next to the sum(time) field in the word form, nothing shows up. Absolutely no data. But it is in the xml. I'm using <?sum(current-group()/EFF)?> , just like I am for <?sum(current-group()/TIME)?> . I've made it text, numeric, decimal. Nothing is coming out.

  • How to deal with table.Field/sum(table.Field) BIEE

    I have a question with this table.Field/sum(table.Field), 
    and another case is: one field of table /another field of a table, but these two tables not directly relation, such as: one day sales(one table)/the last day sales(another table)

    The way to go is hierarchical field names, as it has been said.
    What would give you more flexibility, would be to give your element page's fields logical names. This would lead to building blocks, which can be freely combined. Any logic within the building blocks would not change at all, and logic going beyond a block would be straightforward to set up.
    Hope this can help.
    Max Wyss.

  • Sum a field in repeat region

    Hi There,
    I am trying to sum a field in a repeat region.
    That is, the repeat region displays on page as per normal but then have a total field based on the sub total fields stored in the data base for each record.
    Any help is appreciated.
    Cheers

    Here's a quick idea of how to do it in CF. If you use PHP the principle would be the same.
    <cfset ThisRowTotal = 0 >
    <cfloop query="getPageLinks">
      <cfset ThisRowTotal = ThisRowTotal + YourSubTotalVariable>
        <cfoutput>#ThisRowTotal#<cfoutput>
    </cfloop>
    That's how it would look, what it is doing is each loop it is adding that loop's subtotal to the "ThisRowTotal" variable, then outputting it, so each loop will show the cumulative sub total.
    Hope this helps.
    Lawrence Cramer - *Adobe Community Professional*
    http://www.Cartweaver.com
    Shopping Cart for Adobe Dreamweaver
    available in PHP, ColdFusion, and ASP
    Stay updated - http://blog.cartweaver.com

  • Sum the sum of fields in crystal report

    In crystal report 2008, i have rows of data grouped by document number. Sum of each document (RTotal1) display at Group Footer.
    At the Report Footer level, I want to display the Grand Total. In formula workshop, I tried to add a formula to sum RTotal1 above. However, error message indicated 'this field cannot be summarized'.
    Second try: In Running Total Fields, I tried to add RTotal1 above to the field but error message indicated 'invalid field selection'. Any idea what's the proper way to sum the sum of fields?

    You need to use a variable, create 3 formula
    @reset
    whileprintingrecords;
    global numbervar GTotal:=0;
    //place this in report header, or higher grou header as appropriate
    @Eval
    whileprintingrecords;
    global numbervar GTotal:=GTotal + Sum( valuefield, groupfield);
    // place this in group footer where your sum shows
    @display
    whileprintingrecords;
    global numbervar GTotal;
    //Place this in report or higher group footer
    Ian

  • Sum hidden fields in web dynpro ALV reports

    Hi everyone
    Could anyone tell if it is possible to sum a field that is hidden in an ALV Report in Web Dynpro?
    I need to hide a row so as not to be seen by the user (like the filter option) but with the need that the value that is stated in that hidden row must still impact in the Column Total.
    Thanks!
    Fede

    Hi everyone
    Could anyone tell if it is possible to sum a field that is hidden in an ALV Report in Web Dynpro?
    I need to hide a row so as not to be seen by the user (like the filter option) but with the need that the value that is stated in that hidden row must still impact in the Column Total.
    Thanks!
    Fede

  • Sum of field

    Hi Everybody,
       Can we sum a field in Layout(SAPScript) itself.
       Although it can be calculated in Print Program and sent to Layout but if it can be done in Layout itself then nothing like that.
       Thanks in advance.
    Regards,
    Deva Jyothi Singh

    Hi,
    Please try this(from SAP help),
    The SUMMING command is used for accumulating a total value for a program symbol. The command should be specified just once. Then, each time the specified program symbol is formatted, its current value is added into the total symbol. Several program symbols may all be added into a single total symbol.
    Syntax:
    /: SUMMING program_symbol INTO total_symbol
    SAPscript cannot create the field for the total dynamically. The summing symbol used for totalling must be declared with TABLES in the ABAP program. Otherwise, only zero is added. Declaring the symbol with the DATA statement is not sufficient (global data).
    Thanks
    Vinod

  • Can i sum time fields?? (i expect that yes....)

    Hi everybody.
    I'm a visual basic programmer, actually, visual studio 2005, now i beginning with crystal report for visual studio 2005, nice and easy to use with the wizard, but,,, if i want to do something i little bit complex i can't find a manual for beginners.
    Now Iu2019m trying to do a report that list fields from a typed dataset, that dataset contains same datetime fields i.e. 1:30 , I put that fields in the details region, all it's ok, but the problem became when i try to sum all the times and totalize then.  The reason (i supposed) it's that the4 crystal can't sum time fields.
    Thinking about this, i suppose that i can do something with code but i can't find nothing about this, Can anybody tell me where is a manual to code in crystal report?
    Well, if somebody have any idea please tell me.

    The Crystal syntax doesn't change much from version to version so you can look at our SDK Guide on Diamond.
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/CrystalReports_dotNET_SDK/crsdk_net_doc/doc/crsdk_net_doc/html/crconformulareference.htm
    If you really want to formula reference for Crystal Reports for Visual Studio .NET 2005 you can look here [http://msdn.microsoft.com/en-us/library/ms225334(VS.80).aspx|http://msdn.microsoft.com/en-us/library/ms225334(VS.80).aspx].
    Edited by: David Hilton on Sep 29, 2008 4:47 PM
    Edited by: David Hilton on Sep 29, 2008 4:48 PM

  • Problem in sum a field through select command

    Dear Sir(s),
    I want to sum kbetr (no. of packing) for same knumv(invoice no.) in table konv.
    e.g.
    invoice no.           no. of packing
    (knumv)                   (kbetr)
    001                         2
    001                         3
    002                         4
    002                         5
    result should be -
    invoice no                  no. of packing
    001                               5
    002                               9
    code-
    select knumv kschl sum(distinct kbetr)
    from konv
    into table it_konv
    for all entries in it_vbrk
    where kschl = 'ZFQT'
    and knumv = it_vbrk-knumv
    group by knumv kbetr.
    error showing - unkown col. sum(distinct   field list.
    Please help me immediately.
    thanks,
    R.Kapoor

    Hi..
    Change ur Select statement as below .
    <b>select knumv sum(kbetr)</b>
    from konv
    into table it_konv
    for all entries in it_vbrk
    where kschl = 'ZFQT'
    and knumv = it_vbrk-knumv
    <b>group by knumv .</b>
    Here you need not to Retrieve the Field KSCHL since it is anyway given in the WHERE clause.
    Let me know incase of any other issue.
    <b>Reward if Helpful.</b>

  • Sum quantity field with 5 key fields

    How to sum quantity field with 5 key fields

    try this out.
    loop at <itab>.
         at new <field>.
           sum.
        endat.
    endloop.

  • Sum Total Field?

    I am trying to create a sum total field that is the sum of several other numeric entry fields. Is this possible in FormsCentral? How might I go about doing this?

    Once your Word document is a PDF, you can use Acrobat Pro to enable calculations in individual fields. What I don't know is whether or no you can then use this form to collect FormsCentral data... I haven't tried that yet.
    Here is an Adobe tutorial on how to do basic calculations using Acrobat Pro: http://tv.adobe.com/watch/acrobat-x-tips-tricks/how-do-i-use-basic-calculations-in-a-form/
    Brian

Maybe you are looking for

  • How do you enlarge the font size on lync Iphone App?

    I have my default on my iphone 5 set to large, but the lync app font is far too tiny for me to read. I can't find a setting to enlarge the font on this app.

  • Ext Window in a CFFORM tag

    Guys, I have a problem with the ext window and I dont know how I resolve this. How put a ext window inside a cfform tag? Example: <ext:window id="settings" title="..:: Upload ::.." width="500" height="200" iconCls="settings" modal="true" resizable="t

  • Error : Resource not found in the S/W component versions

    Hello All, I am using Pi 7.1 . I have a scenario IDoc to File . When i execute my end to end scenario i am getting the following error : Unable to find resource bce2fba0-80bd-11de-93f0-e5e70ad6cb21 in the following software component versions: http:/

  • 0crm_complaints_i doesnot extract for few item object types

    Hi Gurus, I need to have data records in BI box with respect to item object types BUS2000164 and BUS2000185. I have tried with 0CRM_COMPLAINTS_I. There I have data records corresponding to BUS2000160, BUS2000161 and BUS2000167. But not the above ones

  • Multiple iTunes problems

    Hey ... hi everybody... well I've got some problems with itunes...the first one its: When I want to close iTunes it freezes... and i have to kill the process... or when i dont use it like for 2 hours it freezes and eat 98% of my cpu usage again i've