Aggregate functions cannot be used in group expressions

Hi have report showing sales by Vendor. I need to list all the vendors with Monthly Total>5000 and combine the rest as "OTHER VENDORS"
Vendor is a Group in my report, so I tried to put an expression as a Group on:
=IIF(Sum(Fields!Mth_1_Sales.Value)>5000,Fields!Vendor_No.Value,"OTHER VENDORS")
I've got an error: "aggregate functions cannot be used in group expressions"
How do I get Vendors with Sales < 5000 into  "OTHER VENDORS" ?

Hi,
You need to group by Month on group expression,
And you can use the same expression in the report column as 
=IIF(Sum(Fields!Mth_1_Sales.Value)>5000,Fields!Vendor_No.Value,"OTHER VENDORS")
Many Thanks
..................................................................................................................................................................Please
mark the post as Please mark the post as answered if this post helps to solve the post.

Similar Messages

  • SSRS countrow Aggregate error(Aggregate and lookup functions cannot be used in query parameter expressions.)

    Below expression works fine with text box but gives error in dataset expression.
    ="SET FMTONLY OFF select  "+ join(Parameters!Column.Value,",") +" FROM pamcustom.dbo.vw_HFL_HFD_HotfileData INNER JOIN pamcustom.dbo.HFL_HFB_HotFileBatch  on BatchID = HFB_intBatchID where BatchID ="+Parameters!BatchId.Value+"
    and "+Parameters!cmbTranType.Value+" "+ iif(CountRows("DS_Aml_Mnr_Iss_Desc")=Parameters!Mnr_Iss_Desc.count," "," and aml_mnr_iss_desc in "+"('" & join(Parameters!Mnr_Iss_Desc.Value,"','")
    & "')")+iif(CountRows("ds_ReportingCategory")=Parameters!ReportingCategory.count," "," and ReportingCategory in "+"('" & join(Parameters!ReportingCategory.Value,"','") & "')")+iif(CountRows("ds_NAICSubGroup")=Parameters!NAICSubGroup.count,"
    "," and naicsubgroup in "+"('" & join(Parameters!NAICSubGroup.Value,"','") & "')")+iif(CountRows("ds_PortTrading")=Parameters!PortTrading.count," "," and porttrading in "+"('"
    & join(Parameters!PortTrading.Value,"','") & "')")+iif(CountRows("ds_GL_LE")=Parameters!GL_LE.count," "," and gl_le in "+"('" & join(Parameters!GL_LE.Value,"','") &
    "')")+iif(CountRows("ds_coagroup")=Parameters!cmbCoaGrp.count," "," and coagroup in "+"('" & join(Parameters!cmbCoaGrp.Value,"','") & "')")+iif(CountRows("Portfolio")=Parameters!cmbPort.count,"
    "," and portfolio in "+"('" & join(Parameters!cmbPort.Value,"','") & "')")+IIf(IsNothing(Parameters!txtSecID.Value)," "," and secid in ('"+Replace(Parameters!txtSecID.Value,",","','")+"')")+iif(IsNothing(Parameters!minPortFilter.Value)
    and IsNothing(Parameters!MinPort.Value)," "," and portfolio "+Parameters!minPortFilter.Value+Parameters!MinPort.Value)+iif(IsNothing(Parameters!maxPortFilter.Value) and IsNothing(Parameters!MaxPort.Value)," ","
    and portfolio "+Parameters!maxPortFilter.Value+Parameters!MaxPort.Value)+iif(IsNothing(Parameters!minCoaFilter.Value) and IsNothing(Parameters!txtMinCoa.Value)," "," and portfolio "+Parameters!minCoaFilter.Value+Parameters!txtMinCoa.Value)+iif(IsNothing(Parameters!maxCoaFilter.Value)
    and IsNothing(Parameters!txtMaxCoa.Value)," "," and portfolio "+Parameters!maxCoaFilter.Value+Parameters!txtMaxCoa.Value)
    I guess the error " Aggregate and lookup functions cannot be used in query parameter expressions." is because I am using CountRow to ensure that if all values of multi select all selected i will not use that filter in where clause.
    Pls. guide...

    Hi, Include your parameter total count in the dataset for parameter and instead of using countrows() function use the count from dataset in the expression.
    Hope this helps.........
    Ione

  • ESOA: "Lean Order functionality cannot be used?" -- RESOLVED!!

    Hello SAP Gurus,
    <b><i>Problem:</i></b> While the sales orders perfectly  get created using "<b>eSOA: ECC_SALESORDER009QR problems.
    <i>Any comments on any part of this message -- hints/feedback on tracing/debugging, no matter how short is the suggestion, would be appreciated!</i>
    Message was edited by:
            Fakher Halim

    Hi Fakher,
    I hada look at your problem the other day when you first raised the issue. I investigated it for nearly an hour but put it aside then because I got really more and more angry with it.
    So, I can't give you any hint but nevertheless decided to drop a short note. I fully agree with your remarks.
    I believe that though SAP in the high ranks rightfully embarked for the right vision towards the SOA paradigm, those who design actual Enterprise Services do it kind of an old-fashioned EAI-way. Maybe the interprete 'Enterprise' in ESOA as 'Intra-Enterprise only'.
    What I came across was a paragraph in the ECC_SALESORDERCRTRC (what should a non-SAP service consumer think of that service reading that name? will he/she ever be able to memorize that?) which stated something like
    <i>Following parameters MUST NOT be supplied any value</i>
    followed by a list of input parameters of the service. What are such parameters good for??
    The other day I came across another Enterprise Service which contained a number of completely cryptic parameters. After some searching I learnt that this were (patented) global data types which you could only understand if you got hold of some several pages long word documents which were at the time only available SAP internally although the services have long been published then. I think they're still kept secret, atl east I have never seen one or seen a reference to it.
    Did you notice that the description of ECC_SALESORDERCRTRC says that it is deprecated and another service should be used instead but it doesn't tell which one?
    I could continue ranting another few hours on this topic but as I found out no one of SAP joins a discussion on this.
    So I can only conclude that Enterprise Services are not meant to be used by any third party service consumer, at least at the moment..
    One last thing. Have you ever seen an enumeration in an Enterprise Service's WSDL? For a long time I thought they have just forgotten to implement it in their current SOAP runtime implementation. I mean, they have a great DDIC, domain values and stuff, they have an inside-out webservice generation wizard but they do not create XSD enumeration restrictions? Why? could it be that they do that on purpose? To make it as difficult as possible for a non-SAP service consumer to understand theservice and auto-generate useful proxies? I wish I would know.
    Concerning the ticket stuff (aka bug reporting tool): Ironically as a third-party service consumer you can't file a CSN ticket no matter how broken the service is. You have to find a SAP customer to file it for you (probably the one whose actual service you want to consume). If you've found bug reporting proxy customer he'll know how to open a ticket.
    sorry that I couldn't be of any help with your problem.
    kind regards, anton

  • Types of functions cannot used in PL/SQL

    I'm trying to find out information on what types of functions cannot be used in PL/SQL. Can someone provide me with some directions and assistance?
    Thanks a lot.
    Tony

    its really depends upon your implementation way..
    if u are callinga pl/sql from a trigger, then you can't use any DDL or DML effecting on the same table.
    If u are calling a function then it must return only one value, it should not written more than one value.

  • Aggregate functions in EJBQL ???

    Does the latest version of Oracle App server support aggregate functions like SUM/COUNT/AVG in the EJBQL?

    Does the latest version of Oracle App server support aggregate functions like SUM/COUNT/AVG in the EJBQL? Hi Swami --
    The latest version of Oracle9iAS - v903 is J2EE 1.3 compatible so it supports all of the EJB 2.0 specification.
    The EJB 2.0 specification lists the following functions for EJBQL:
    String Functions:
    CONCAT(String, String) returns a String
    SUBSTRING(String, start, length) returns a String
    LOCATE(String, String [, start]) returns an int
    LENGTH(String) returns an int
    Arithmetic Functions:
    ABS(number) returns a number (int, float, or double)
    SQRT(double) returns a double
    The latest version of the EJB 2.1 specification which will be part of J2EE 1.4, has added support for aggregate functions like orderby, sum, count, etc.
    11.2.7.2 Aggregate Functions in the SELECT Clause
    The result of an EJB QL query may be the result of an aggregate function applied to a path expression.
    The following aggregate functions can be used in the SELECT clause of an EJB QL query: AVG,
    COUNT, MAX, MIN, SUM.
    We will support these when the EJB 2.1 specification is finalized and we produce our J2EE 1.4 compatible implementation.
    cheers
    -steve-

  • Aggregate function on "large value type"

    We are constrained to use a model that stores records in a main table and various attributes of the record in a second table. Something like this: main record table CAR, attribute table CAR_DETAILS with CAR_DETAILS have key value pairs like "color"
    "blue" and "doors" "4".
    For reports we need to flatten the one to many nature of this to get CAR and color and doors by using an aggregate function like: 
    car_id, max(car_detail.value) filtered on car_detail.key = "color", max(car_detail.value) filtered on car_detail.key = "doors". 
    This works on other tables but the car_detail table (shall we say) appears to store its values as blobs. In any case when we attempt to aggregate we get "The query uses an aggregate function on a large value type expression. Large value type expressions
    can not be aggregated."
    Since we can't change the model, we would need to use another function to change this to a smaller string (or date, these are actually mostly date), but none of the very limited set of functions available seems to work to make this aggregation possible (and
    there is no "first" or anything else similar). 
    The list of functions available in Report Model Queries can be found at https://msdn.microsoft.com/en-us/library/ee210538.aspx
    Appreciate any ideas on how to solve this
     

    I found a work around : create a second dataset reversing the direction:
    car_detail.key, car_detail.value, car_id
    with this filtered by car_detail.key = "color" (or doors etc)
    Then use a lookup from the first dataset to the second to display the data:
    =Lookup(Fields!car_Id.Value,Fields!Icar_Id.Value,Fields!car_detail.Value, "DataSet2")
    where the 1st field is in the main report dataset, the second and third are in the lookup dataset, and the 4th parameter is the name of the lookup dataset. 
    Would still really like to have a solution that allows aggregation for ease of use and efficiency. 

  • Cannot perform an aggregate function on an expression containing an aggregate or a subquery.

    I am getting "Cannot perform an aggregate function on an expression containing an aggregate or a subquery." error by executing below query, I need to calculate the percentage. Can you please help me on this by modifying the query.
    select oe2.OrdSourceID,Count(oe2.OrdSourceID) as TotalOrders,
    Percentage = Count(oe2.OrdSourceID) * 100.0 / SUM(Count(oe2.OrdSourceID))
      from OeOrders Oe 
      iNNER JOIN OeOrders2 AS oe2
           ON Oe.OrderID = oe2.OrderID
    where
    Oe.ProviderID = 'JOHN' and Oe.OrderDateTime between '10/07/2014' and '10/15/2014' and oe2.OrdSourceID is not null
      AND Oe.[Status] NOT IN ( 'CANCEL', 'CANC', 'CNC', 'UNVER', 'UNV' )
    Group by oe2.OrdSourceID
    Thanks..
    Diddi

    Hi,
    please check this general solution using CTE. If you need a specific query help then pls post your DDL+DML :-) I hope you can get the idea from this example.
    /************************************************ DDL+DML */
    -- DDL
    create table T (Num int, Name nvarchar(10))
    -- DML
    insert T values (1,'a'),(2,'a'),(3,'s'),(22,'s')
    GO
    /************************************************ Testing and solution */
    select SUM(count(*))
    from T
    GO
    --Msg 130, Level 15, State 1, Line 7
    --Cannot perform an aggregate function on an expression containing an aggregate or a subquery.
    ;with MyCTE as (select count(*) C, Name from T group by Name)
    --select * from MyCTE
    select SUM(C), Name
    from MyCTE
    group by Name
    GO
    /************************************************ Clean */
    drop table T
    GO
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Why Scalar Subquery expression cannot be used in HAVING clauses?

    Hi All,
    I'm new to SQL. I'm confused with Scalar Subquery.
    Is there anyone who can answer me why Scalar Subquery expression cannot be used in HAVING clauses.
    Can you show me a example?
    Thanks very much,
    Xianyi.Ye
    Edited by: 908428 on 2012-1-16 下午7:24

    Hi,
    908428 wrote:
    Hi Frank,
    Thank you for your quick reply. I also agree with your point.
    But when I read the book, "OCA Oracle Database SQL Certified Expert Exam Guide",( link to illegal copies of book removed by moderator )
    on Page 359, it said that
    Scalar subquery expressions cannot be used in the following locations:
    1. In CHECK constraints
    2. In GROUP BY clauses
    3. In HAVING clauses
    4. In a function-based index (which is coming up in Chapter 11)
    5. As a DEFAULT value for a column
    6. In the RETURNING clause of any DML statement
    7. In the WHEN conditions of CASE
    8. In the START WITH and CONNECT BY clauses, which we discuss in
    Chapter 16.7 and 8 are wrong. Scalar sub-queries can be used in WHEN conditions and START WITH and CONNECT BY clauses. (At least in Oracle 10.2. Is the book based on some earlier version?)
    Edited by: BluShadow on 17-Jan-2012 09:08

  • Using Aggregate function in queries

    Hi all,
              Please take a look on this query and suggest me why i'm getting the error..
    This is my simple query using aggregate function in it..
    SELECT T1.NAME, T1.DESCRIPTION, SUM(T2.QUANTITY)
    FROM TABLE1 T1, TABLE2 T2
    WHERE T1.ID=T2.ID
    GROUP BY T1.NAME, T1.DESCRIPTION
    Above query added with a sub-query in the select segment..
    SELECT T1.NAME, T1.DESCRIPTION, SUM(T2.QUANTITY), (SELECT AVG(T3.PRICE) FROM TABLE1 TT1, TABLE3 T3 WHERE TT1.ID=T3.ID AND TT1.ID=T1.ID) AV_PRICE
    FROM TABLE1 T1, TABLE2 T2
    WHERE T1.ID=T2.ID
    GROUP BY T1.NAME, T1.DESCRIPTION
    When i add a sub-query which has aggregate function in it, i'm getting the 'ORA-00979: not a GROUP BY expression' error.

    What is your DB Version. Your query works without any issue in my DB. I used WITH clause to create the sample data. The query highlighted in BLUE is the actual query.
    SQL> select * from v$version where rownum = 1;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    SQL> with table1
      2  as
      3  (
      4    select 1 id, 'karthick' name, 'user name' description from dual
      5  ),
      6  table2
      7  as
      8  (
      9    select 1 id, 100 quantity from dual
    10  ),
    11  table3
    12  as
    13  (
    14    select 1 id, 10 price from dual
    15  )
    16  select t1.name
    17       , t1.description
    18       , sum(t2.quantity)
    19       , (
    20           select avg(t3.price)
    21             from table1 tt1
    22                , table3 t3
    23            where tt1.id = t3.id
    24              and tt1.id = t1.id
    25         ) av_price
    26    from table1 t1
    27       , table2 t2
    28   where t1.id = t2.id
    29   group
    30      by t1.name
    31       , t1.description;
    NAME     DESCRIPTI SUM(T2.QUANTITY)   AV_PRICE
    karthick user name              100         10
    SQL>

  • Group By Select Statement aggregate function error.

    I am using Dreamweaver MX4 and have an ASP web page. I can easily do this in Access 2007 a simple "group by" sum totals statement.
    Why can I not get this to work on a web page? Are the "#" signs messing this up in the Code2 Select Statement?
    How can I get Code2 to work correctly? Code1 works fine. A user enters the customer and a date range on a form and submits request. I get error message in Dreamweaver. You tried to execute a query where the specified expression field3 is not part of an aggregate function
    Code1. This works fine SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #1/2/09# AND Field6 <= #1/30/09#  GROUP BY Field3, Field10
    Code2. I get error message SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #Date1# AND Field6 <= #Date2#  GROUP BY Field3, Field10

    I am using Dreamweaver MX4 and have an ASP web page. I can easily do this in Access 2007 a simple "group by" sum totals statement.
    Why can I not get this to work on a web page? Are the "#" signs messing this up in the Code2 Select Statement?
    How can I get Code2 to work correctly? Code1 works fine. A user enters the customer and a date range on a form and submits request. I get error message in Dreamweaver. You tried to execute a query where the specified expression field3 is not part of an aggregate function
    Code1. This works fine SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #1/2/09# AND Field6 <= #1/30/09#  GROUP BY Field3, Field10
    Code2. I get error message SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #Date1# AND Field6 <= #Date2#  GROUP BY Field3, Field10

  • Error in using aggregate function in Outer Query in Siebel Analytics

    Hi,
    When I am using aggregate function in outer query in Siebel Analytics I am facing error.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59111] The SQL statement must include a GROUP BY clause. (HY000)
    Bellow is the code.
    SELECT test1.username saw_0, test1.desg saw_1,COUNT (test2.querydate) saw_2
    FROM (SELECT POSITION.CBL username,
    POSITION.CBP desg
    FROM "CM"
    WHERE (POSITION.BPTCD = 'Marketing')
    AND (POSITION.EDate =TIMESTAMP '1899-01-01 00:00:00'
    ) test1,
    (SELECT users.UN username,
    measures."Query Count" querycount,
    measures."Max Total Time" secs,
    topic.db dashboardname,
    "Query Time".DATE querydate
    FROM "Plan"
    WHERE (topic."Dashboard Name" IN ('DS'))) test2
    WHERE test2.username = LOWER (test1.username)
    AND test2.dashboardname = 'DS'
    GROUP BY test1.username, test1.desg

    Should your query be a valid SQL query?
    I can't think that the query you have would be valid in a SQL plus window.
    Chris

  • Problem in using aggregate functions inside case statement

    Hi All,
    I am facing problem while using aggregate functions inside case statement.
    CASE WHEN PSTYPE='S' THEN MAX(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ELSE SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) END,
    how can I achieve above requirement ? Con anyone help me.
    Thanks and Regards
    DG

    Hi All,
    Below is my query:
            SELECT
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT
            ELSE POS.PACCT || '-' || DECODE(POS.SYSTEMCODE,'GMI1','1', 'GMI2','2', 'GMI3','4', 'GMI4','3', '0') ||POS.PFIRM|| NVL(POS.POFFIC,'000') END,
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-')
            ELSE POS.PFIRM||POS.POFFIC||POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-') END,POS.SYSTEMCODE,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,POS.PEXCH||DECODE(POS.PSUBEX,'<NULL>',''),
            POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END ,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,*SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ,SUM(DECODE(POS.PBS,2,ABS(POS.PPRTQ),0))* ,
            POS.PCLOSE,SUM(POS.PMKVAL) ,
            TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.UBS_ID,POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER ,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,TO_CHAR(POS.BUSINESS_DATE,'YYYYMMDD'),
            POS.SOURCE_GMI_LIB,
            --DECODE(POS.SYSTEMCODE,'GMI1','euro','GMI2','namr','GMI3','aust','GMI4','asia','POWERBASE','aust','SINACOR','namr',POS.SYSTEMCODE),
            DECODE(p_reportid,'RVPOS_SING','euro','RVPOS_AUSTDOM','aust','RVPOS_AUSTEOD','euro','RVPOS_GLBLAPAC','asia','POS_RV_SN','namr','POS_PB','aust',POS.SYSTEMCODE),
            POS.RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            NULL,
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN POS.PSUBTY='S' THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL
            FROM POSITIONS_WRK POS LEFT OUTER JOIN
            (SELECT * FROM CDS_PRODUCTS CP INNER JOIN FUTURE_MASTER FM ON
            (CP.STRXCH=FM.ZEXCH AND CP.SFC=FM.ZFC AND CP.BUSINESS_DATE = FM.BUSINESS_DATE )) C ON POS.PCUSIP = C.SCUSIP
            AND NVL(POS.PCUSP2,'X') = NVL(C.SCUSP2,'X')
            WHERE
            POS.PEXCH NOT IN ('A1','A2','A3','B1','B3','C2','D1','H1','K1','L1','M1','M3','P1','S1')
            AND (POS.PSBCUS IS NOT NULL OR POS.PCTYM IS NOT NULL OR POS.PSTYPE ='S')
            AND POS.BUSINESS_DATE = run_date_char
            GROUP BY
            POS.UBS_ID,POS.SYSTEMCODE,POS.RECIPIENTCODE,POS.BUSINESS_DATE,POS.PACCT,POS.PFIRM,POS.POFFIC,POS.PCUSIP,POS.PBS,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,
            POS.PEXCH,POS.PSUBEX,POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2)  || SUBSTR(POS.PCTYM,1,4) END,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,POS.PCLOSE,TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,POS.PSUBTY,POS.SOURCE_GMI_LIB,RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN PSUBTY = 'S'  THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END;Now, could you plz help me in replacing the bold text in the query with the requirement.
    Thanks and Rgds
    DG
    Edited by: BluShadow on 16-May-2011 09:39
    added {noformat}{noformat} tags.  Please read: {message:id=9360002} for details on how to post code/data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Aggregate function using DB adapter

    Is it possible to use aggrgeate functions like count and things like ROWNUM using the DBAdapter wizard in BPEL 10.1.2 ?
    For Example how can I configure a query like
    Select * from emp where ROWNUM<500

    hi all,
    i think there is no way to define external functions like ROWNUM and all in bpel 10.1.2 as we can not write manual sql query in expression block and expression builder don't have aggregate functions .
    But, in 10.1.3 we can write any sql query in expression and it is working fine.
    Is it a bug in 10.1.2?

  • How to use aggregate function with Date

    Hi All,
    I have a group of date from that is it possible to Max and Min of date.
    I have tried like this but its errored out <?MIN (current-group()/CREATION_DATE)?>.
    I have also tried like this but it doesnt works
    <?xdoxslt:minimum(CREATION_DATE)?>
    Is it possible to use aggregate function with date values.
    Thanks & Regards
    Srikkanth

    Hi KAVI PRIYA,
    if date is not in cannonical format, how can we change it in BI publisher, then how to calcualte minimum and as well as maximum.
    please advise me,
    Thanks,
    Sri

  • How to Use a Group by Function

    Hi Gurus,
    I have Requirment where i need to use the group by function to one column
    below is my query , can anyone help how to use the group by for the column OCCASIONALS_QT_STATUS.
    below is giving me the error not a group by expression
    select distinct source_id,OCCASIONALS_QT_STATUS,
    (SELECT sum(head_count)
    FROM gen_dcsf_occasionals_count
    where OCCASIONALS_QT_STATUS = 'QTS'
    and source_id = gdoc.source_id
    ) OccasionalsQTS,
    (SELECT sum(head_count)
    FROM gen_dcsf_occasionals_count
    where
    OCCASIONALS_QT_STATUS = 'NOTQTS'
    and source_id = gdoc.source_id
    ) OccasionalsNOTQTS,
    (SELECT sum(head_count)
    FROM gen_dcsf_occasionals_count
    where
    OCCASIONALS_QT_STATUS = 'NTKNWN'
    and source_id = gdoc.source_id
    ) OccasionalsNOTKNWN
    from gen_dcsf_occasionals_count gdoc group by OCCASIONALS_QT_STATUS;
    any inputs on this is highly appreciable
    Thanks in advance

    909577 wrote:
    Hi Gurus,
    I have Requirment where i need to use the group by function to one column
    below is my query , can anyone help how to use the group by for the column OCCASIONALS_QT_STATUS.
    below is giving me the error not a group by expression
    select distinct source_id,OCCASIONALS_QT_STATUS,
    (SELECT sum(head_count)
    FROM gen_dcsf_occasionals_count
    where OCCASIONALS_QT_STATUS = 'QTS'
    and source_id = gdoc.source_id
    ) OccasionalsQTS,
    (SELECT sum(head_count)
    FROM gen_dcsf_occasionals_count
    where
    OCCASIONALS_QT_STATUS = 'NOTQTS'
    and source_id = gdoc.source_id
    ) OccasionalsNOTQTS,
    (SELECT sum(head_count)
    FROM gen_dcsf_occasionals_count
    where
    OCCASIONALS_QT_STATUS = 'NTKNWN'
    and source_id = gdoc.source_id
    ) OccasionalsNOTKNWN
    from gen_dcsf_occasionals_count gdoc group by OCCASIONALS_QT_STATUS;
    any inputs on this is highly appreciable
    Thanks in advanceFor your own sanity, you should format your code to make it more readable
    For the sanity of those from whom you seek help, you should preserve that formatting with the code tags:
    select
         distinct source_id,
         OCCASIONALS_QT_STATUS,
         (SELECT
               sum(head_count)
          FROM
               gen_dcsf_occasionals_count
          where
               OCCASIONALS_QT_STATUS = 'QTS'   and
               source_id = gdoc.source_id
         ) OccasionalsQTS,
         (SELECT
              sum(head_count)
         FROM
              gen_dcsf_occasionals_count
         where
              OCCASIONALS_QT_STATUS = 'NOTQTS' and
              source_id = gdoc.source_id
         ) OccasionalsNOTQTS,
         (SELECT
              sum(head_count)
         FROM
              gen_dcsf_occasionals_count
         where
              OCCASIONALS_QT_STATUS = 'NTKNWN' and
              source_id = gdoc.source_id
         ) OccasionalsNOTKNWN
    from
         gen_dcsf_occasionals_count gdoc
    group by
         OCCASIONALS_QT_STATUS;

Maybe you are looking for

  • How to print a smart form in two diff languages runtime

    Hi friends, we have a requirement to print a smart form in two langauges one in english and other in Spanish those selection has to given by check box condition. pls send some stuff . Thanks & Regards Jagadeeshwar.B

  • File upload from smartphone?

    Currently your file upload field does not allow smartphone users to upload images/videos, any chance this may be possible soon? I used the following html5 coding on a separate site page and works well: <form action="server.cgi" method="post" enctype=

  • MENU BAR ITEMS ON RIGHT SIDE ARE GONE!!!

    I am using 10.2.8 on my iBook. All the menu bar items on the right side (audio, date and time, internet connect, airport) are suddenly GONE and there is nothing I can do to get them back. Clicking show battery status in the menu bar does not work. Di

  • Unable to use decimal data in the datasources in the IOP RELEASE 11.1.2.1

    Hi, I have created a datasource of type Database and given an sql query which is fetching some of the decimal data. But when I am checking preview for the sql query, it is showing integer data (rouding off the decimal value) even though the field typ

  • Master record in MM

    what are the master record in MM other than material master and vendor master?