Error: Group Function Is Not Allowed Here

Post Author: simiora
CA Forum: WebIntelligence Reporting
Hi,
Created a measure in the Universe, which is based on a BO built-in function "PERCENTILE".
When this measure is in the WebI report, this field is also added to the GROUP BY caluse of the select statement, which will give the above error.
Is measure defined wrong? How to eliminate a field from the GROUP BY clause. We are using Oracle database and BOXI Rel 2.
Thanks.

Lucy,
begin
select max(sim_trip.finish_time) into finish_time,
      max(sim_trip.start_time) into start_time  from sim_trip
WHERE ((sim_trip.operator_counter = :P500_operator_counter));
if (:P500_start_time > finish_time)
   then   return true;
else
return false;
end if;
end;Your select statement is wrong. It should be:
begin
select max(sim_trip.finish_time),max(sim_trip.start_time)
  into :P500_start_time,:P500_finsh_time 
  from sim_trip
  WHERE ((sim_trip.operator_counter = :P500_operator_counter));
if (:P500_start_time > :P500_finish_time)
   then   return true;
else
return false;
end if;
end;Robert
http://apexjscss.blogspot.com

Similar Messages

  • PL/SQL equivalent of T-SQL - "group function is not allowed here"

    Hi all, hope someone can give me a hand as I'm pretty stuck! I have been trying to convert some MS SQL Server T-SQL statements into Oracle PL/SQL and am stuck on the below one:
    SELECT
    CA.AssessmentID,
    (SELECT ProductName + ISNULL(' - ' + PrincipalBenefit,'')
    FROM rptPolicySnapshot WHERE PolicyID = MAX(CA.PolicyID)
    AND SnapshotID = 1),
    MAX(CA.PolicyID)
    FROM rptClaimInvoiceLineSnapshot CIL
    INNER JOIN rptClaimAssessmentSnapshot CA
    ON CIL.AssessmentID = CA.AssessmentID
    AND CIL.SnapshotID = CA.SnapshotID
    WHERE CIL.SnapshotID = 1
    GROUP BY CA.AssessmentID
    This works fine in MSSQL but returns the below error in Oracle:
    'ORA-00934: group function is not allowed here'
    If I take out the subquery the query works fine.
    Any ideas as to the syntax? I am new to Oracle so not sure as to how I should go about writing this.
    Thanks in advance!
    Leo

    WITH x AS (SELECT   ca.assessmentid,
                        MAX (ca.policyid) policy_id
               FROM rptclaiminvoicelinesnapshot cil
                    INNER JOIN rptclaimassessmentsnapshot ca
                        ON cil.assessmentid = ca.assessmentid
                       AND cil.snapshotid = ca.snapshotid
               WHERE cil.snapshotid = 1
               GROUP BY ca.assessmentid
    SELECT x.assessment_id,
           x.policy_id,
           productname + decode(principalbenefit,null,null,' - ' || principalbenefit ) prodname
    FROM   rptpolicysnapshot, x
    WHERE  policyid = x.policy_id
    AND    snapshotid = 1I think that's in the neighbourhood.

  • ORA-00934: group function is not allowed here

    Hi,
    My requirement is to check oi.quantity is equal to sum of packing_detail. quantity
    by order_number
    select oi.quantity_ordered oi_qu, pd.quantity pq
    from ordered_items oi, packing_details pd
    where oi.ordered_item_id = pd.ordered_item_id
    and oi.quantity_ordered = sum(pd.quantity)
    and oi.order_number = '29';
    after executing above query I get error
    SQL Error: ORA-00934: group function is not allowed here
    00934. 00000 - "group function is not allowed here"
    Please tell me how to resolve it.
    Thanks in advance
    Sandy

    You have to make use of a subquery;
    select oi.quantity_ordered oi_qu, pd.quantity pq
    from ordered_items oi, packing_details pd 
    where oi.ordered_item_id = pd.ordered_item_id 
    and oi.quantity_ordered = *(select sum(pd.quantity) from packing_details pd1 group by pd1.ordered_item_id)* 
    and oi.order_number = '29';  This is based on the assumption that ordered_items is the summarize data and packing_details are the line item level data.
    regards,
    Dipankar.

  • PL/SQL: ORA-00934: group function is not allowed here

    Hi,
    I am writing a PL/SQL procedure. The structure is like :
    SET SERVEROUTPUT ON;
    CREATE OR REPLACE Procedure abc
    IS
    v_total_ip_rec number(14);
    v_total_op_rec number(14);
    v_total_rec number(14);
    BEGIN
    SELECT SUM (CASE
    WHEN <condition 1>
    THEN 1
    ELSE 0
    END
    ) into v_total_ip_rec,
    SUM (CASE
    WHEN <condition 2>
    THEN 1
    ELSE 0
    END
    ) into v_total_op_rec,
    SUM (1) into v_total_rec
    FROM A,B
    WHERE A.Col1=B.Col1;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END;
    When I run this procedure it gives me following error:
    "PL/SQL: ORA-00934: group function is not allowed here"
    Anybody have any idea?
    Any help would be appreciated.
    Thanks.

    Hi Arunkumar ,
    I think you don't need subquery.
    Regards Salim.
    Or.
    SELECT COUNT (CASE
                     WHEN <condition 1>
                        THEN 1
                  END) v_total_ip_rec,
           COUNT (CASE
                     WHEN <condition 2>
                        THEN 1
                  END) v_total_op_rec,
           COUNT (1) v_total_rec
      FROM a, b
    WHERE a.col1 = b.col1

  • ORA-00934: group function is not allowed here Error - On validation screen

    Can anyone help me with this funtion Returning boolean PL/SQL expression
    begin
    select max(sim_trip.finish_time) into finish_time,
          max(sim_trip.start_time) into start_time  from sim_trip
    WHERE ((sim_trip.operator_counter = :P500_operator_counter));
    if (:P500_start_time > finish_time)
       then   return true;
    else
    return false;
    end if;
    end;

    Lucy,
    begin
    select max(sim_trip.finish_time) into finish_time,
          max(sim_trip.start_time) into start_time  from sim_trip
    WHERE ((sim_trip.operator_counter = :P500_operator_counter));
    if (:P500_start_time > finish_time)
       then   return true;
    else
    return false;
    end if;
    end;Your select statement is wrong. It should be:
    begin
    select max(sim_trip.finish_time),max(sim_trip.start_time)
      into :P500_start_time,:P500_finsh_time 
      from sim_trip
      WHERE ((sim_trip.operator_counter = :P500_operator_counter));
    if (:P500_start_time > :P500_finish_time)
       then   return true;
    else
    return false;
    end if;
    end;Robert
    http://apexjscss.blogspot.com

  • Group function is not allowed here

    Hi,
    I have a problem running the following sql command, i know the error is over the count function, but i don't know how to solve this. Can you please help me solve this.
    ( i would like to select titles that have more than 2 authors.)
    select distinct titles.title_id, titles.title_name, titles.publisher_ID
    from authors, titles, author_titles
    where titles.title_ID= author_titles.title_id
    and author_titles.au_id = authors.au_id and count(authors) > 2
    ORDER BY titles.title_id DESC ;
    thank Yoy

    Sorry i'm new to databases....
    I tried to add the group by function ... but i still get errors
    select distinct titles.title_id, titles.title_name, titles.publisher_ID
    from authors, titles, author_titles
    where titles.title_ID= author_titles.title_id
    and author_titles.au_id = authors.au_id
    group by titles.title_id
    having count(authors.au_id) > 2
    ORDER BY titles.title_id DESC ;
    error
    select distinct titles.title_id, titles.title_name, titles.publisher_ID
    ERROR at line 1:
    ORA-00979: not a GROUP BY expression
    * >>> on titles.title_name

  • Group function is not allowed here - where statement

    I have a select that is basically:
    select a,b,
    sum(c),sum(d),
    sum(c) - sum(d)
    from A
    group by a, b
    I would like to add:
    where sum(c) - sum(d) <> 0
    I know that I can't use the sum function in the where statement.
    Any ideas how I can get around it?
    Thanks.
    Leah

    Hi ,
    for instance ... using the count aggregate function... which is the same as using sum function.....
    SQL> select job , cnt_emp , cnt_sal
      2    from
      3    (
      4      select job, count(empno) cnt_emp, count(sal) cnt_sal
      5        from emp
      6      group by job
      7    )
      8   where cnt_emp- cnt_sal=0
      9  /
    JOB                            CNT_EMP    CNT_SAL
    CLERK                                5          5
    SALESMAN                             5          5
    PRESIDENT                            1          1
    MANAGER                              3          3
    ANALYST                              2          2Greetings....

  • Getting Group Function is not Allowed

    Hello All....
    When I run the following in the SQL command screen it works fine... But when I try to use it in APEX to populate page values, it gives me the error...
    ERROR
    1 error has occurred
    ORA-06550: line 25, column 74: PL/SQL: ORA-00934: group function is not allowed here ORA-06550: line 24, column 1: PL/SQL: SQL Statement ignored
    CODE THAT WORKS IN SQL COMMAND SCREEN
    SELECT
    SUM(CASE WHEN SLOT = 'Q' THEN '1' ELSE '0' END) AS C_SLOT,
    SUM(CASE WHEN TEST = 'P' THEN '1' ELSE '0' END) AS C_TEST,
    FROM TBL_REC;
    CODE THAT GIVES ERROR ON APPLICATION EXPRESS PAGE
    SELECT
    SUM(CASE WHEN SLOT = 'Q' THEN '1' ELSE '0' END) INTO :P2_C_SLOT,
    SUM(CASE WHEN TEST = 'P' THEN '1' ELSE '0' END) INTO :P2_C_TEST,
    FROM TBL_REC;
    The colums SLOT and TEST have letter codes, I just want it to count just when it matches a certain letter. In the SQL Command Screen, it is returning one row, with the counts, everything is fine. It is only a problem when I try to use it anywere on a page in Application Express.
    The full version has about 20 lines that are all sum lines, but I can not even get the 2 line ver above to work.
    Any thoughts?

    This will work .. the into clause goes after the select columns ... into var1 ,var2 etc ..
    SELECT SUM(CASE
                 WHEN SLOT = 'Q' THEN
                  '1'
                 ELSE
                  '0'
               END),
           SUM(CASE
                 WHEN TEST = 'P' THEN
                  '1'
                 ELSE
                  '0'
               END)
      INTO :P2_C_SLOT, :P2_C_TEST,
      FROM TBL_REC;SS

  • Help - error : ORA-00984: Column not allowed here

    Hi,
    I'm writing a simple Java program to update values into Oracle tables. But getting error - 'ORA-00984: Column not allowed here' in the line - sql2.executeUpdate(acctTabSql);
    There is no column name used in 'insert statement - and referred suggestion here to resolve the error, but couldn't. Please write me how to resolve it. ?
    Here is the code snippet below.
    Thanks, Vasu
    T_ACCT
    ACCT_ID (PK) GEN INTEGER
    ALS_NBR:STRING
    STATUS_CD:STRING
    NOTE_DT:DATE
    int intVal1 = 0;
              int intVal2 = 0;
              Statement sql1 = oraConnection.createStatement();
              ResultSet rs = sql1.executeQuery("SELECT ACCT_ID_SEQ.NEXTVAL, APPL_ID_SEQ.NEXTVAL FROM DUAL");
              while(rs.next()){
              intVal1 = rs.getInt(1);
              intVal2 = rs.getInt(2);
              System.out.println("ACCT_ID :" + intVal1);
              System.out.println("APPL_ID :" + intVal2);
              sql1.close();
              Statement sql2 = oraConnection.createStatement();
              String acctTabSql = "INSERT INTO VPDBO.T_ACCT (ACCT_ID, ALS_NBR, NOTE_DT, HELMS_NBR, SL_REF_NBR, BK_MSG_RECEIVED_DT) " +
                        "VALUES (intVal1,'' ,'' ,'' ,'' ,'' )";
              System.out.println(acctTabSql);
    -/Error/-     sql2.executeUpdate(acctTabSql);
              sql2.close();
              Statement sql3 = oraConnection.createStatement();
              String applTabSql = "INSERT INTO T_APPL (APPL_ID, ACAPS_ID, STATUS_CD, ACAPS_PROD_CD, ACCT_ID, DCAPP_MSG_RECEIVED_DT) " +
                        "VALUES (intVal1, valappIdValue, 'EN', '', intVal2, '08/26/09')";
              System.out.println(applTabSql);
              sql3.executeUpdate(applTabSql);
              sql3.close();
              oraConnection.commit();

    Hi,
    make sure final statement is like :
    INSERT INTO VPDBO.T_ACCT (ACCT_ID, ALS_NBR, NOTE_DT, HELMS_NBR, SL_REF_NBR, BK_MSG_RECEIVED_DT)
    VALUES(intVal1,NULL,NULL,NULL,NULL,NULL)instead of
    String acctTabSql = "INSERT INTO VPDBO.T_ACCT (ACCT_ID, ALS_NBR, NOTE_DT, HELMS_NBR, SL_REF_NBR, BK_MSG_RECEIVED_DT) " +
    "VALUES (intVal1,'' ,'' ,'' ,'' ,'' )";Cheers,
    Avin ash

  • IDOC error 51- Function module not allowed:

    Hi,
    I am getting following error in IDOC inbouond.I verifyed all parameters mentioned in error.
    Issue still not resolved.
    When debugged from WE19 this issue dosnt arise.
    Kindly guide.
    Function module not allowed: ZIDOC_INPUT_MATCLASS
    Message no. B1252
    Diagnosis
    The function module ZIDOC_INPUT_MATCLASS and the application object type BUS1001 which were determined are not valid for this IDoc.
    Procedure
    1. Please check that the process code in the inbound partner profile is correct.
    2. If this is the case, you should check the ALE inbound methods ALE inbound methods for the process code and see whether the specified function module and application object type are correct.
    3. If this is also the case, then the function module and the application object type are not permitted for the logical message type, message variant, message function and basis type that are contained in the IDoc control record. You should check whether the correct values have been assigned to these fields in the control record. If they do have the correct values, then the assignment to the function module and the application object type needs to be maintained.

    Hi,
    Check in WE42, for the process code, you have assigned this function module and given the correct process code in the partner profile.
    Sujay

  • Idoc error 51 - "Function module not allowed - APPL_IDOC_INPUT1'

    Hello everyone,
    We are uploading GL balances from legacy to SAP using the LSMW Bapi
    object - bus6035
    method - post
    message type - ACC_DOCUMENT
    Basic type - ACC_DOCUMENT03
    When we run the lsmw, idoc is created, however with an error 51 saying
    "Function module not allowed - APPL_IDOC_INPUT1'
    The partner no. is the logical system (the system on which the lsmw is executed)
    In the partner profile, we have defined this as LS. In the inbound parameters, we have defined message type = ACC_DOCUMENT, the process code is APL1 and the corresponding function module is - APPL_IDOC_INPUT1
    Please let me know if we are missing something or doing anything wrong ?
    Since the data in the LSMW will be read frmo a file on the presentation server, do we need to have a port configuration for the same ?
    Thanks,
    Sushil Joshi`

    Hello Sushil
    The long text of message B1(252) is quite informative for error analysis:
    NA B1252
    Short Text
         Function module not allowed: &
    Diagnosis
         The function module  and the application object type  which were
         determined are not valid for this IDoc.
    Procedure
         1.  Please check that the process code in the  inbound partner profile
             is correct.
         2.  If this is the case, you should check the ALE inbound methods ALE
             inbound methods for the process code and see whether the specified
             function module and application object type are correct.
         3.  If this is also the case, then the function module and the
             application object type are not permitted for the logical message
             type, message variant, message function and basis type that are
             contained in the IDoc control record. You should check whether the
             correct values have been assigned to these fields in the control
             record. If they do have the correct values, then the assignment to
             the function module and the application object type needs to be
             maintained.
    On ECC 6.0 this long text contains 3 transactions for analysis:
    - WE20
    - BD67
    - WE57
    Regards
      Uwe

  • Error: Request function SUCH not available here

    Hi Guys,
    When user try to open an existing order via VA02 below pop up error is appearing
    Request function SUCH not available here
    when i see SM12 i see couple of lock entries, though i remove these entries, still getting the same error again.
    Please help!
    Yash

    Please check Note 67836 - "tablesParm IS REQUESTED" in update functions
    Hope it helps
    Regards
    Sai

  • Error while creating Notification: Partner Function is Not Allowed in Partner Determination Profile Q2

    During Notification Creation I get the error --Partner Function is Not Allowed in Partner Determination Profile Q2
    As I enter Purchase Document Number in the transaction QM01 and press Enter. I get the above error and donot go further.
    Can anyone help me here.

    Hello Prashant,
    You are missing some configuration for the partner function;
    Go- to
    SPRO>IMG>QM>Quality Notifications>Notification Creation>Partners>Define partner Determination Procedure>
    Again Select "Define Partner Determination Procedure".
    Select Quality management> Change Partner
    Now Select Q2.
    Compare settings with Partner Determination Procedure on any other client. Also check Partner functions on the same screen.
    Amol.

  • "Function module not allowed" error message

    Hi,
    We created a special FM to be processed when the INVOIC is in inbound processing. We link the FM to the process code and the process code to the partner functions. We get the error message; "Function module not allowed: & name of our FM". However, when we reprocess the idoc via WE19, it goes through.
    Did somebody ever face that situation?
    Thanks
    Martin

    Hi
    is it for MRM  .  If it is ,I faced the same Problem Martin .go to EDIFCT table give ur basic type and execute and check for entries .if there no issue other wise goto we57 and maintain the entry for basic type .

  • Sequence Number does not allowed here

    Hi,
    I am inserting rows in a table called membership with seqence number membership_id.nextval. But i am getting error like
    "Sequence number not allowed here"
    Before i inserted about 3852 rows in that table
    Here is the statement i am using
    INSERT INTO MEMBERSHIP (membership_id,ACTIVIST_ID,G_N_ID,ROLE_ID,
    REGION_ID,START_dATE,END_DATE,STATUS,state_id)
    SELECT membership_id.nextval,a.activist_id,G.g_n_id,R.ROLE_ID,
    '',mwlgmemship.start_date,'','Active',''
    FROM activist a,
    role r,
    group_network g,
    final.mwlgmemship mwlgmemship,final.mwlgmem mwlgmem
    WHERE
    a.first_name=mwlgmem.fname and a.last_name=mwlgmem.lname and a.c_zip_code=mwlgmem.czip and
    a.c_country=mwlgmem.country and mwlgmem.person_id=mwlgmemship.person_id and
    to_char(mwlgmemship.grno)=g.g_n_reference and mwlgmemship.role_id=r.role_id order by r.role_id
    I could not understand the problem, please help me
    I am selecting the other fields from other tables.
    Thanks
    Srinivas

    Restrictions on Sequence Values You cannot use CURRVAL and NEXTVAL in the following constructs:
    A subquery in a DELETE, SELECT, or UPDATE statement
    A query of a view or of a materialized view
    A SELECT statement with the DISTINCT operator
    A SELECT statement with a GROUP BY clause or ORDER BY clause
    A SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator
    The WHERE clause of a SELECT statement
    The DEFAULT value of a column in a CREATE TABLE or ALTER TABLE statement
    The condition of a CHECK constraintAbove text is from the sql reference manual.
    HTH
    Regards
    Raj

Maybe you are looking for

  • Can i use my ipod on more than one computer?

    ok i have my comuter at home and then a computer at work. and basically i want to use them both to update my computer but ive heard you can only use it on one computer because if you install it onto another one it clears the hard drive? so can i have

  • Opening a new browser window from flash

    Does anyone know of a method fo opening a link in a new window in firefox from within flash that isn't blocked by the popup blocker. It seems like the security in FF 2.0.0.6 (I'm on 2.0.0.11) has been tightened to prevent any _blank or window.open ca

  • Load data only for current month using ABAP Routine

    Hi Everyone, I am loading data from R/3 using the 0HR_PA_OS_1 extractor. This requirement is to load the position numbers from R/3. Using the extractor for a given position 28 I get the following dataset results. CALMONTH  POSITION 11-2004          

  • Recording from aux track

    I am using an Aux track to monitor external audio. Any chance it is possible to create some sort of environment setting to allow me to record a track directly from there?

  • QR Code Scanning

    Hi There! I am new to SAP and to sdn community as well. Hence please bear with me if this is not the right place for the question below and would appreciate anyone redirecting me to the right forum. I am looking to see if there are ways in SAP that c