Sumifs function question

Hi, Everyone, I have a function question of Sumifs, here a sample as follows,
=SUMIFS(Budget :: E4:E14,Budget :: C4:C14,"=5003677000",Budget :: B4:B14,OR("=Transit","=Drawing cash")), according to the logic, I think like this, but it's wrong. So how to insert the OR function to the Sumifs function? May someone find the mistake in the function?
Thank you.
Alex

I think you would actually do a sum of simifs, i.e. Sumif(....."Transit") + Sumif(....."Drawing Cash")
Basically if you have two sumifs that differ in only one condition that would be treated like an OR in SQL, then make one Sumif for each unique set of  conditions and add them up
Jason

Similar Messages

  • Date Syntax for SUMIFS Function

    Converting my accounting from Excel to Numbers. Huge data sets ...
    I have a SUMIFS function that works properly using a manually typed date but I cannot figure out how to use the Today() function.
    This works: SUMIFS(Amounts, Account, B3, Check Date, B5) where B3 is the code for the specific account and B5 contains <=12/31/2009 - note there are no quotes around the expression.
    BUT, I don't want to manually enter the date everyday. I want to use the Today() function for condition. It works if I use Today() in B5 but returns only the totals for today's transactions. I need to be able to use "less than or equal to Today" for the condition but I cannot figure out the syntax.
    If we can figure that out, then I want to use "less than or equal to Today PLUS X" where X is a variable I can enter in B7 to look at projected cash flow 7, 14 or 21 days out.
    Any help? Thanks

    Jane Knox wrote:
    Yvan!
    That worked. Thank you! When I posted the question I thought you would be the one to answer.
    Thanks for the feedback.
    I'm sure that Ashka, Badunit, Barry, Fruhulda, Jaxjason, Jerrold … are able to respond the same.
    The difference is that I was in front of my computer when they weren't
    I would NEVER be able to figure that out
    Not surprising, the syntax required to use a reference to a cell in a testr is not described in delivered resources.
    Very different from Excel...
    Happily, Numbers isn't duplicating Excel behaviour. A world with a single kind of spreadsheet would be really annoying
    Yvan KOENIG (VALLAURIS, France) samedi 26 décembre 2009 18:12:19

  • Guest list functions, questions, etc.

    Hey everyone,
    I've only just started using Numbers today, so a lot of the forum posts about functions and so on didn't make much sense to me. Now, what I'm trying to do is the following: I'm trying to create a guest list for a party and a pie chart with it to show the female/male ratio attending. Now, I've just popped in a picture of what I have done so far:
    As you can see, I have added check boxes for attending and for the gender of the respective guests. Now, what I wanted to find out was the total amount of guests attending (including people that guests are bringing along -> number of attendees). So I put the function "=SUMIF(attending;TRUE;number of attendees)" into I11. I got this function from the Event Planer template in Numbers. So now every time I tick someone's 'attending' box, the sum changes and gives me the number, which is great! But what I now want is two seperate sums for women and men, so that I can use that information in the pie chart. So what I want is a similar function as the one above but with two conditions: that the person's 'attending' box is ticked and that, in the case of the sum for the women, the person's 'female' box is ticked and the other way around for the sum for the men. Then in the fields 'C11' and 'D11' I'd have the total number of women attending and the total number of men. So if anybody could give me a SUM function with those two conditions, I'd be grateful. I've been fiddling with adding plusses and changing the function to a SUMIFS function but I always get syntax errors or other problems.
    My second question is whether anybody knows a way of adding two check boxes to one field, so that you tick one and then the second one is automatically unticked. A 'one or the other' choice, so that you don't have a situation like the one displayed on my picture, that Megan Fox is both male and female does anyone know of a way to insert two check boxes into one field and making only one of them 'choosable'?
    Thanks in advance guys!
    XtremeFluX

    XtremeFluX wrote:
    Hey everyone,
    As you can see, I have added check boxes for attending and for the gender of the respective guests. Now, what I wanted to find out was the total amount of guests attending (including people that guests are bringing along -> number of attendees). So I put the function "=SUMIF(attending;TRUE;number of attendees)" into I11. I got this function from the Event Planer template in Numbers. So now every time I tick someone's 'attending' box, the sum changes and gives me the number, which is great! But what I now want is two seperate sums for women and men, so that I can use that information in the pie chart. So what I want is a similar function as the one above but with two conditions: that the person's 'attending' box is ticked and that, in the case of the sum for the women, the person's 'female' box is ticked and the other way around for the sum for the men. Then in the fields 'C11' and 'D11' I'd have the total number of women attending and the total number of men. So if anybody could give me a SUM function with those two conditions, I'd be grateful. I've been fiddling with adding plusses and changing the function to a SUMIFS function but I always get syntax errors or other problems.
    From my point of view, there is no need for two columns attending / not attending. A single 'attending' one is sufficient
    Same thing for genders.
    As far as I know, a single box (choose the one which you want) would be sufficient.
    Your problem is not completely defined.
    If I read correctly, there is no way to know the gender of the person(s) accompannying a given one so there is no way to calculate correctly the number of each gender.
    My second question is whether anybody knows a way of adding two check boxes to one field,
    This unavailable feature would be better done with radio buttons .
    In this table There are two header rows and two footer ones.
    In C11, the formula =COUNTIF(C,TRUE) calculates the number of male guests.
    In C12, the formula =COUNTIF(C,FALSE) calculates the number of female guests.
    In F11, the formula =COUNTIF(F,TRUE) calculates the number of attending guests.
    In F12, the formula =COUNTIF(F,FALSE) calculates the number of non attending guests.
    In G11 the formula =SUMIFS(G,F,TRUE,C,TRUE) calculate the number of attending persons whose guest one is a male.
    I guess that you encountered problems with SUMIFS because the parameters are not ordered as they are for SUMIF.
    Read carefully the descriptions of both functions in iWork Formulas and Functions User Guide
    Yvan KOENIG (VALLAURIS, France) samedi 9 janvier 2010 19:33:13

  • SD & FI BI functional Questions

    Hi Experts,
    I need to ask some questions to customer on SD & FI functional related questions for BI Analytical reports..
    Already cutomer implemented Data ware house Informatica with congnos reporting tool.
    right now they want to implement BI.
    please any one can share on what type functional questions could ask the customer.
    Advance Thanks,
    Bala.

    Hi,
    A few more pointers.
    Start with Reports. What the client is using. What he is expecting.
    If he got existing reports map the fields with Business Content BW Fields. Go to Business content and make a list of queries which are delivered from SAP. Explain them the KPI's. This should be good to start with. Also check the Tcodes they use.
    Look for DataSources that get data from theses Tcode's.
    Project Preparation (Initial stuff -- Do a conceptual review after this phase requirements gathering)
    Collect requirement thru interviews with Business teams /Core users / Information Leaders.
    Study & analyze KPI's (key figures) of Business process.
    Identify the measurement criteria's (Characteristics).
    Understand the Drill down requirements if any.
    Understand the Business process data flow if any.
    Identify the needs for data staging layers in BW – (i. e need for ODS if any)
    Understand the system landscape.
    Prepare Final Requirements Documents in the form of Functional Specifications containing:
    Report Owners, Data flow, KPI's, measurement criteria's, Report format along with drilldown requirements.
    Hope this helps.
    Thanks,
    JituK

  • OIC: Functional Question(11.5.10)

    Hi All,
    I would like to know answer for the following functional question in Oracle 11.5.10 Incentive Compensation Application(OIC). I would greatly appreciate if you anyone can reply for this.
    1. Question on Foreign currency exchange rates:
    We know that OIC cannot handle foreign currency exchange rates. Since all of our offer letters to the Sales guys are in local currency what we end up doing is picking an exchange rate on July 1st every year and converting them to US $. What I’m wondering is why couldn’t we just set them up in OIC in their local currency, without converting them?
    Is that possible? OIC can handle this?
    2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
    a) Is that possible?
    b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
    Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
    Thanks,
    Johnson
    Edited by: user10413783 on Jun 23, 2009 4:06 PM

    Hi Johnson,
    2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
    Yes
    b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
    Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
    You do not need to set up the dummy resource as employee. All you need is to create as OTHER type of resource and add that resource to group.
    Hope this helps.
    Thanks
    Srini

  • BUG in Excel 2010 SUMIF & SUMIFS functions [EDIT: also AVERAGEIF & -IFS]

    I am quite certain that there is a bug in the implementation of the SUMIF function of Excel 2010. In certain special cases the function returns
    its evaluation argument instead of the correct result. This bug is reproducible in Excel 2010, but does not occur in Excel 2007 (or earlier, as far as I can tell).
    The SUMIF function accepts the arguments "Range", which is the range of identifiers which the function evaluates against; "Criteria", which is
    the criteria that defines which members of "Range" will be chosen to sum, and "Sum_range", which is the (optional) range of values to sum. "Range" and "Sum_range" do not need to reside on the same worksheet in order for the function to return correct results.
    This means that "Range" and "Sum_range" can refer to the same column of different worksheets, and this is where the bug occurs. As an example,
    say we have the formula =SUMIF(Sheet1!E:E;2;Sheet2!E:E). This will return 2 (i.e. the "Criteria" argument), regardless of which values are in column E of Sheet2. If we move the data in Sheet2 to column D or F, however, the same formula (e.g. =SUMIF(Sheet1!E:E;2;Sheet2!F:F)
    will return the correct result.
    I have just noticed that the same error occurs with the SUMIFS function.
    Bug resolution please? :)

    Hi!
    An alternative methd don't solve my problem. Although I state that the 32bit version of Excel 2010 is now corrected of this bug. I wonder why the 64bit version is not....  I have to work with large Excel files and with this king of bugs I can't get
    the most of 64bit Excel.
    I'm surprised that no alternative methods of calculation will work in Excel 2010 64-bit and be compatible with other versions.
    So what other functions do not work?
    I guess SUMPRODUCT also doesn't work when referring to a range in another workbook. That is one of the ways we used to get the same results as AVERAGEIF before that function became available in 2007.  There are also array formulas that can refer to
    other worksheets.
    Or is your problem solely related to not being able to use particular functions in Excel 2010 64-bit, and not to solving your calculation problem?
    Ron
    I've upgraded the Office version from 2007 to 2010 64bit and I want to use my earlier Excel files to calculate and update data that I need to use in another software.
    I noticed that the averageif and sumif formulas don't update their values if they refer to other worksheets or workfiles and after a web search I get to this forum.
    I inferred that these bugs were corrected for all versions of Excel 2010… that’s not the case!
    My workfiles are huge and I have to do calculations between workfiles and worksheets, update existing links, and so on… Excel 2010 64bit perform very well in
    my machine in terms of speed! But not with these bugs!!!
    Since I have not the time to redo all my previous work (done in Excel 2007) you can say that my problem solely relates to not being able to use particular functions
    in Excel 2010 64-bit!!! I have deadlines!!!
    I suppose that Microsoft would gladly thank its customers to report bugs of its products and would try to solve them! I guess wrong!!! Sorry for that!

  • Incremental updates on collections/full schedule - Functional question

    Hi everyone,
    At a customer of mine we have the following set-up:
    Almost all applications are deployed User Based
    Collections are used for targetting the applications
    Incremental updates are enabled on practically all collections which deploy applications
    For the moment this setup is active for 498 collections (out of 714  collections).
    Since it's not advised and Microsoft recommends to only have incremental updates active for 200 collections, I would like to change this setup by means of POSH. I have just finished writing it, but I still have a functional question:
    Which schedule time would be best to activate for the collections? Keep the standard value to update collection every 7 days?
    When would you activate "incremental updates"? Device collections with required software for faster deployment time?
    I only foresee the following "downside":
    We have a lot of applications who are available to "all domain users". When the AD-account is created, it will sync with SCCM and will receive their deployements. But by changing the update schedule to, let's say, 7 days.. They wouldn't be able
    to see and install these applications if the collections haven't been updated yet?
    Thanks for the insight with your experience!
    Kr,
    Sven

    Wow Jörgen, thanks for this information! This was something I haven't read about. Will keep this in mind.
    In your blog, you mention that you use this tool to keep track of performance issues. When do you feel that there are too many collections which have incremental updates enabled (by using the tool)?
    The last weeks/months, we have a lot of issues during OSD. We have collections to which the TS is deployed.
    In orchestrator we have a runbook to add workstations to SCCM + add workstation to collection + update membership of collection. But the update takes from 5 minutes to 40 minutes.. So this is the main issue that we have..
    @Andrew: Thanks for your contribution! I believe you are speaking of "Global Conditions"? I haven't used it either, but I thought that this had some downsides.. For instance, we target most of the applications "Used Based" (since MS is
    moving to user centric deployment). So if I target the application to the "all users" collection and create a "global condition" to only install when user is a member of a specific AD-group (for instance: Skype), then the user still sees
    "skype" in the application catalog and will have an error upon installing it when he is not a member of the skype AD-group.
    Maybe this is completely wrong what I'm saying.. Just did some brainstorming with collegues but haven't found the time to play with it in a test environment. @Jörgen: Please enlighten us if I'm wrong.

  • Performance issue and functional question regarding updates on tables

    A person at my site wrote some code to update a custom field on the MARC table that was being copied from the MARA table.  Here is what I would have expected to see as the code.  Assume that both sets of code have a parameter called p_werks which is the plant in question.
    data : commit_count type i.
    select matnr zfield from mara into (wa_marc-matnr, wa_marc-zfield).
      update marc set zfield = wa_marc-zfield
         where werks = p_werks and matnr = wa_matnr.
      commit work and wait.
    endselect.
    I would have committed every 200 rows instead of every one row, but here's the actual code and my question isn't around the commits but something else.  In this case an internal table was built with two elements - MATNR and WERKS - could have done that above too, but that's not my question.
                DO.
                  " Lock the record that needs to be update with material creation date
                  CALL FUNCTION 'ENQUEUE_EMMARCS'
                    EXPORTING
                      mode_marc      = 'S'
                      mandt          = sy-mandt
                      matnr          = wa_marc-matnr
                      werks          = wa_marc-werks
                    EXCEPTIONS
                      foreign_lock   = 1
                      system_failure = 2
                      OTHERS         = 3.
                  IF sy-subrc <> 0.
                    " Wait, if the records not able to perform as lock
                    CALL FUNCTION 'RZL_SLEEP'.
                  ELSE.
                    EXIT.
                  ENDIF.
                ENDDO.
                " Update the record in the table MARC with material creation date
                UPDATE marc SET zzdate = wa_mara-zzdate
                           WHERE matnr = wa_mara-matnr AND
                                 werks = wa_marc-werks.    " IN s_werks.
                IF sy-subrc EQ 0.
                  " Save record in the database table MARC
                  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                    EXPORTING
                      wait   = 'X'
                    IMPORTING
                      return = wa_return.
                  wa_log-matnr   = wa_marc-matnr.
                  wa_log-werks   = wa_marc-werks.
                  wa_log-type    = 'S'.
                  " text-010 - 'Material creation date has updated'.
                  wa_log-message = text-010.
                  wa_log-zzdate  = wa_mara-zzdate.
                  APPEND wa_log TO tb_log.
                  CLEAR: wa_return,wa_log.
                ELSE.
                  " Roll back the record(un save), if there is any issue occurs
                  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
                    IMPORTING
                      return = wa_return.
                  wa_log-matnr   = wa_marc-matnr.
                  wa_log-werks   = wa_marc-werks.
                  wa_log-type    = 'E'.
                  " 'Material creation date does not updated'.
                  wa_log-message = text-011.
                  wa_log-zzdate  = wa_mara-zzdate..
                  APPEND wa_log TO tb_log.
                  CLEAR: wa_return, wa_log.
                ENDIF.
                " Unlock the record from data base
                CALL FUNCTION 'DEQUEUE_EMMARCS'
                  EXPORTING
                    mode_marc = 'S'
                    mandt     = sy-mandt
                    matnr     = wa_marc-matnr
                    werks     = wa_marc-werks.
              ENDIF.
    Here's the question - why did this person enqueue and dequeue explicit locks like this ?  They claimed it was to prevent issues - what issues ???  Is there something special about updating tables that we don't know about ?  We've actually seen it where the system runs out of these ENQUEUE locks.
    Before you all go off the deep end and ask why not just do the update, keep in mind that you don't want to update a million + rows and then do a commit either - that locks up the entire table!

    The ENQUEUE lock insure that another program called by another user will not update the data at the same time, so preventing database coherence to be lost. In fact, another user on a SAP correct transaction, has read the record and locked it, so when it will be updated your modifications will be lost, also you could override modifications made by another user in another luw.
    You cannot use a COMMIT WORK in a SELECT - ENDSELECT, because COMMIT WORK will close each and every opened database cursor, so your first idea would dump after the first update. (so the internal table is mandatory)
    Go through some documentation like [Updates in the R/3 System (BC-CST-UP)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTUP/BCCSTUP_PT.pdf]
    Regards

  • Basic Functionality Questions - Is a computer required to serve content, etc?

    I'm sorry if these are no-brainers. I ask them because I thought I had understood how an AppleTV worked, and had planned on buying one, until a friend who owns one insisted that the device functions differently than I had understood it to. I think he's wrong, but I was hoping you guys could clear up a few things for me.
    1) Does an AppleTV require that I have another device (iPad, Computer running iTunes, etc) on and connected to watch content purchased from my iTunes account, or will it stream directly from the 'net?
    2) If I've converted video content from a source other than the iTunes store (for example, ripped a DVD and imported it to my computer's iTunes library) can I stream it to my AppleTV (assuming the source computer is on?)
    3) Assuming #2 is true, the content in question must be served by a computer - ie, I can't move it to the cloud, and viewing it is dependant on having my computer on and running. Is this correct?
    Thanks in advance guys!

    1- it will stream purchased items such as TV shows, not music unless you have the  iTunes match subscription. You need another device if you want to do "home sharing" (share your iTunes library with other devices, If you have already bought movies, music, etc.)
    2- You will have to import it to iTunes if you want to see it on your ATV.
    3- Yes, you need to have a computer act as a server with iTunes running all the time...

  • An MM functional question

    Hi all,
    I have a question like
    Report has to extract the details related to invoices and payments to Vendors for the list of Purchase Orders for goods and services procured which are selected in the input screen. The report should calculate the time in days,   from   when the Purchase Order (services/goods) is released and till the time payment is made to the Vendor. It should take into account the invoice document posted and the payment terms for the Vendor in order to get the correct due date. It should give the difference in terms of days between invoice due date and payment date and indicate whether the payment was done before or on the due date.
    Iam confused with the flow becz iam not able to relate the ekbe (po history) and the BSIS , BSAK table to get the vendor data as the ekbe (belnr shows the material document No) and the the BSIS and BSAK shows the (A/c document No).
    can any one help me in this this is a urgent requirement.
    Thanks,
    SriRatna

    SriRatna,
    Pl let me know your email address so that I can email you the material prepared by me, this will give you complete overview of getting the data from different tables and their relationship based on the scenarios we commonly face in all different functional modules.
    Thanks,
    Sridhar Kamisetti

  • Oracle XE Functionality Question

    Hello,
    I am here trying to get the opinion of Oracle XE users regarding a project I am considering.
    Currently, my employer uses Access databases, with the master on a corporate server, and 4 slaves on local servers at warehouses. At each warehouse, there are probably 10-30 new records created per day by 2 or 3 users at each location, which get synced to the main at the end of each day. Any changes that need to be made at the corporate level get synced and sent on to the warehouse as needed.
    Besides sending out these changes, the corporate office will also add 40-50 records per day. Information is also pulled for reports- seemingly pretty normal Access tasks. I don't know the exact stats, but each backed up copy of the DB is less than 100mb, so it's not a huge system. (It's for keeping track of inbound and outbound shipments, carriers, locations, etc.) There are probably 6 users at this location.
    So the question I have is, would XE have the functionality to at least cover these tasks, and possibly more. (What more is at the moment, I do not know.) My own preference would be to grow into Oracle DB, but if the Access functions cannot be replicated, we would probably move on to something else, so I thought I'd ask for current user experience.
    Thanks for your time.

    Hi,
    I think application running on XE and Apex suits for your current situation perfectly.
    And if system gets bigger you can get license of "full" Oracle database and upgrade.
    Using single database server and web application everything is "online" and you do not need transfer any data end of day.
    XE 10G database comes with Apex 2.1. That Apex version is quite old.
    But you can upgrade Apex to latest one.
    http://www.oracle.com/technetwork/developer-tools/apex/overview/index.html
    There is coming XE 11G that ship latest Apex and features that 10G do not have.
    You can also save more user data to XE 11G. But I assume XE 10G 4GB limit is enough for you.
    http://www.oracle.com/technetwork/database/express-edition/11gxe-beta-download-302519.html
    Regards,
    Jari
    Edited by: jarola on Aug 16, 2011 11:31 AM
    I did find this blog that is actually running on XE and Apex
    http://www.apexninjas.com/blog/f?p=100:1:1421570076381594::::P1_ARTICLE:
    I think you can not run blog application on MS Access =)
    Also I think Oracle database have much more features than Access, specially with Apex.

  • CRM functional questions

    HI,
    can anyone please post some CRM functional interview questions. I have seen only technical questions so far. I am not interested in answers. This is urgent
    Regards,
    Karthik

    Hi Karthik,
    Refer the following links:
    http://searchsap.techtarget.com/generic/0,295582,sid21_gci1149410,00.html
    http://searchsap.techtarget.com/general/0,295582,sid21_gci1108668,00.html
    <b>Reward points if it helps.</b>

  • Analytic function question

    I have been trying to fix this since yesterday ad I am close, here is the question
    CREATE TABLE P_X_STG
      PID  NUMBER,
      EID  VARCHAR2(10 BYTE)
    CREATE TABLE TAB_C
      EID  VARCHAR2(10 BYTE),
      X    NUMBER
    SET DEFINE OFF;
    Insert into P_X_STG
       (PID, EID)
    Values
       (1, 'e3');
    Insert into P_X_STG
       (PID, EID)
    Values
       (1, 'e1');
    Insert into P_X_STG
       (PID, EID)
    Values
       (1, 'e2');
    Insert into P_X_STG
       (PID, EID)
    Values
       (2, 'e3');
    Insert into P_X_STG
       (PID, EID)
    Values
       (2, 'e4');
    Insert into P_X_STG
       (PID, EID)
    Values
       (3, 'e5');
    COMMIT;
    SET DEFINE OFF;
    Insert into TAB_C
       (EID, X)
    Values
       ('e1', 100);
    Insert into TAB_C
       (EID, X)
    Values
       ('e3', 300);
    Insert into TAB_C
       (X)
    Values
       (400);
    COMMIT;we match both the tables by eid
    if the eid matches, get corresponding x information
    if a pid has multiple different eids, for matching eid, get corresponding x information, but for non matching, simply put a NULL to x
    for matching eids, print "ematch", for non matchig eids, print "pmatch"
    in the below query, for non matching eids, we copy x information from matching ones, can someone help me substitute tha with Null
    SELECT pid,
                eid,
                x,
                ematch
           FROM (  SELECT p.pid,
                          p.eid,
                          CASE
                             WHEN p.eid = c.eid THEN c.x
                             ELSE LAG (x) OVER (ORDER BY pid)
                          END
                             x,
                          CASE WHEN p.eid = c.eid THEN 'ematch' ELSE 'pmatch' END
                             ematch
                     FROM p_x_stg p, tab_c c
                    WHERE p.eid = c.eid(+)
                 ORDER BY pid, eid)
          WHERE x IS NOT NULL
       ORDER BY pid;
    result is
    1     e1     100     ematch
    1     e2     100     pmatch
    1     e3     300     ematch
    2     e3     300     ematch
    2     e4     300     pmatchI want below result
    1    e1    100    ematch
    1    e2    null    pmatch
    1    e3    300    ematch
    2    e3    300    ematch
    2    e4    null    pmatchfor 1, e2 and 2, e4, instead of copying, just put null
    Edited by: user650888 on Apr 6, 2012 12:29 PM

    Hi,
    user650888 wrote:
    thanks, can this be combined into one query ?Do you mean without a sub-query?
    Why? What's wrong with a sub-query?
    If uisng a sub-query is the clearest and most efficient way to get the results you want, why wouldn't you want to use a sub-query?
    Suppose there was a way, that involved some other technique. How would we know that you didn't object to that technique as well?
    At any rate, I don't see how to do it without a sub-query. Analytic functions are computed after the WHERE clause is applied. If you want to use the results of an analytic function in a WHERE clause (as here, we want to use the results of the analytic COUNT function in a WHERE clause), then you have to compute the analytic function separately, in another (sub-) query.

  • Another MAX()  function question...

    Help was provided earlier for a question I had regarding use of the MAX function... This also pertains to that. I have two tables, employee and movie. I want to find the name of the employee who has entered the most amount of movies into our database. The query I have come up with so far (it's a little messy) is:
    SQL> select firstname, max(m) from (select firstname, count(enteredby) m from em
    ployee, movie where enteredby = id group by firstname) group by firstname;
    FIRSTNAME MAX(M)
    Peter 6
    Swanson 5
    Kevin 7
    Beverly 3
    So I have this table returned, now in this case I want to be able to select from this subquery the first name "Kevin", since he has entered in the most movies. In my head this seems so easy, "Grab the firstname of the person whose max(m) is the largest", but I am just having trouble getting this thought translated into a proper query!

    You can always do
    SELECT firstname
      FROM (SELECT firstname, RANK() OVER (ORDER BY max_m) rnk
              FROM (<<your query>>))
    WHERE rnk = 1Note that you'll need to alias the MAX(m) result first. You could also do
    SELECT firstname
      FROM (
    SELECT firstname, RANK() OVER( ORDER BY cnt) rnk
      FROM (SELECT firstname, COUNT(enteredby) cnt
              FROM employee e, movie m
            WHERE enteredby = id
            GROUP BY firstname)
    WHERE rnk = 1From a style standpoint, I would suggest that you get in the habit of aliasing your tables in your FROM clause and putting that alias on every column name to make it clear which table a particular column was selected from.
    I would also suggest that you come up with a column naming convention that caused the same value to be named the same (or similar) thing in different tables. Joining an ID column from one table to an ENTEREDBY, for example, would be a non-obvious bit of logic. It probably makes more sense to have an EMPLOYEE_ID and an ENTERED_EMPLOYEE_ID column.
    Justin

  • Problem using SUMIF function

    The formula assistent as well as the help text describes the SUMIF syntax as:
    =SUMIF(test-range, “test”, [sum-range])
    When using above however I get a "Syntax error" message. The fix I found was to change the , to a ; so when the formula reads:
    =SUMIF(test-range; “test”; [sum-range]) it works!.
    It could be a localisation issue. I use OSX 10.4.10 english language, location Denmark.

    Thanks Matthias,
    Guess we are in the same boat us Europeans - struck by a product not functioning properly outside the US local zone
    The use of $ for absolute cell reference is also not working in a non US zone, and its amasing that such simple things can slip through quality control. It really kills the pleasure of using numbers, and I hope Apple will come up with a fix ASAP!

Maybe you are looking for

  • Using select-option in webdynpro for ABAP where I have two separate pages

    Hi Experts,          I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on th

  • Why can't I get email when traveling?

    I can't figure this one out. Everything works fine at home, but like today I am out of town and trying to connect without success. The first place I tried (where my wife is working) allowed me to put in the password and connect but I get the message

  • CRM IDoc

    Hello Every one, I am new to this forum. I would like some information regarding CRM. I would like to know: What are CRM IDocs? How they differ from Idocs in SAP R/3? What is CRM module? How XI and Crm are related? If anyone can provide me with web l

  • Delay - job created by the RAISE EVENT

    It's possible to change the scheduling of a job created by a RAISE EVENT, and instead of executing immediately, to schedule it as +1 minute delay? Thanks! PS: i have to wayt because, after the event, some tables are updated in my program and i have t

  • Flat file to table - send mail report on error

    Hello, I've created simple project - loading data from csv flat file to oracle database table, using this tutorial: http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfile-to-table/odi_project_flatfile-to-table.