Group by value

Hi All,
I am looking into a query that I find difficult to output the desire data set. Working on Oracle 10g.
Table data
ID     TYPE            ATRB
1     24          Y
1     25          Y
2     19          N
2     18          N
3     43          N
3     42          Y
4     28          Y
4     29          Y
5     10          N
5     11          Y
Seeking for OUTPUT
ID     TYPE            ATRB
3     43          N
3     42          Y
5     10          N
5     11          YIf ATTRB is different for set of records on ID column then we need to have the above output
For example ID 3 and 5 have different ATTRB value.
Thanks in advance
Saz

Hi,
Here's one way:
WITH     got_atrb_cnt     AS
     SELECT  id, type, atrb
     ,     COUNT (DISTINCT atrb) OVER (PARTITION BY id)
                     AS atrb_cnt
     FROM     data
SELECT  id, type, atrb
FROM     got_atrb_cnt
WHERE     atrb_cnt     > 1
;If you'd care to post CREATE TABLE and INSERT statements for your sample data, then I could test it.

Similar Messages

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

  • Origin Group as Value field in COPA - Is that Possible

    Hello Gurus,
    The business requirement is to see all the Origin Groups as Value fields in COPA - Is that Possible? If Yes, Please suggest me the steps to follow.
    Thanks a lot for your time.
    Regards,
    PM

    Hi Praveen
    Origin group cant be a Value Field.. It can be a Characteristic...
    Try with these 2 options
    1. KEA5 - Click on Create/Change a new Char and Try to create it with reference from table MBEW... If this is allowed, you will be able to plug in the Field Origin group in yur COPA data structure... regenerate your op concern after this
    2. If (1) is not allowed, then create a WW char and write a derivation rule in KEDR with ref to Table LOOKUP and use table MBEW
    Regards
    Ajay M

  • JMS Property Group ID value sent from PI to MQ

    Hello,
    We have interface scenario where our messages are being sent from PI7.0 to MQ. We have JMS Receiver adapter configured for sending messages to JMS queues on MQ.
    We have set the adapter specific message attributes and setting the Group ID using dynamic configuration. In the additional message properties, we are passing the Group ID to JMSXGroupID of MQ. While monitoring messages in the Adapter engine, we can see the GroupID value populated in the dynamic config properties of message but corresponding Group ID value on MQ side comes as null.
    At adapter engine level, I can see this:
    - <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
      <sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/usr/sap/iface/xi/batch/mq/za</sap:Record>
      <sap:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSMessageProperty0">ID:5A414E41414D53414331313030383031313030383139</sap:Record>
      <sap:Record namespace="http://sap.com/xi/XI/System/File"
    Can anyone help us on this. Is there any setting or configuration that specifies that the JMS property is propagated to MQ Group ID or is there anything to be checked/done on MQ end?
    Thanks.
    Swapna

    Hello!
    As you told us the problem is not with setting the property.
    The problem is that when the message is sent to the JMS queue, the IBM driver does not set the property.
    This could be because your target client is not JMS compliant, is this?
    Best regards,
    Franklin Ayres

  • Column formatting based on grouping data value- advanced data grid

    Hello Everyone,
    I am using advanced data grid to display hierarchial data nested upto depth 4. I have to color the leaf nodes conditionally based on  the grouped column value.
    Say for Eg.,
    If the data is something like
    Company
         Manager
              Jim          $4000
              John        $3000
         Accountant
              Smith     $2000
              Sam       $3000
    I have to color Jim and John based on they being a manager. In other words, how do I get Manager and Company information for the leaf rows. The data is serial to start with and I am grouping it before displaying.
    Please let me know how this could be done.
    Thanks
    Arun

    Once htmldb.oracle.com is available again, you may have a look in my demo application:
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    In the tab section I, you will find several examples on pop-up pages. There this conditional
    displaying is included as well.
    Denes Kubicek

  • How to group these values month by month ?

    Hi,
    I have a nice SQL statement which returns days by days, the values of a device.
    WITH S1 AS
      (SELECT DATE1,
        ROUND(AVG(VALEUR),2) Debit
         FROM EVV_E032
        WHERE DATE1 BETWEEN TO_DATE('01012006000000', 'DDMMYYYYHH24MISS') AND TO_DATE('31122006235959', 'DDMMYYYYHH24MISS')
      AND CLEF_VAR =
        (SELECT CLEF_VAR FROM SITE_DEBIT_RIVIERE WHERE SITE = 'E032'
    GROUP BY date1
    SELECT NULL LINK    ,
      TO_CHAR(n, 'DD.MM'),
      NVL(ROUND(AVG(Debit),2), 0) "Débit"
       FROM
      (SELECT TRUNC(TRUNC(to_date(2006,'YYYY'),'year'), 'DD')-1 + level n,
        rownum jours
         FROM dual CONNECT BY level<=366
      ) days
    LEFT JOIN s1
         ON days.n = TRUNC(date1,'DD')
    GROUP BY n
    ORDER BY nSample values :
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('10/02/2006 09:49:59','DD/MM/YYYY HH24:MI:SS') 1,63);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('21/02/2006 10:35:12','DD/MM/YYYY HH24:MI:SS') 1,68);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('21/02/2006 11:30:30','DD/MM/YYYY HH24:MI:SS') 0);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('23/02/2006 14:02:02','DD/MM/YYYY HH24:MI:SS') 0);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('23/02/2006 16:22:34','DD/MM/YYYY HH24:MI:SS') 0);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('30/04/2006 18:09:08','DD/MM/YYYY HH24:MI:SS') 1,72);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('20/05/2006 11:57:02','DD/MM/YYYY HH24:MI:SS') 1,72);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('07/06/2006 15:11:58','DD/MM/YYYY HH24:MI:SS') 1,79);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('08/06/2006 20:00:26','DD/MM/YYYY HH24:MI:SS') 1,82);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('19/06/2006 09:42:32','DD/MM/YYYY HH24:MI:SS') 1,72);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('20/06/2006 04:30:00','DD/MM/YYYY HH24:MI:SS') 1,82);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('20/06/2006 10:39:01','DD/MM/YYYY HH24:MI:SS') 1,72);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('24/06/2006 19:34:50','DD/MM/YYYY HH24:MI:SS') 1,82);
    Insert into "EVV_E032" (DATE1,DEBIT) values (to_date('26/06/2006 14:37:26','DD/MM/YYYY HH24:MI:SS') 1,88);The output are values grouped day by day. I would like to group tehse values month by month, but could not figure how to do. Even though I am not a newbie newbie on SQL, this code is going far too much for me. I know some of you guys can handle this. I tried hard but coud not succeed. Could you help me ?
    Regards, Christian.

    Difficult to work out (read: too much hassle) with your data and sql, as you haven't provided a set of info for all the tables provided, but hopefully this will give you an idea:
    with my_tab as (select trunc(sysdate)+30 dt, 1 val from dual union all
                    select trunc(sysdate) dt, 2 val from dual union all
                    select trunc(sysdate) dt, 20 val from dual union all
                    select trunc(sysdate)+30 dt, 10 val from dual union all
                    select trunc(sysdate)+60 dt, 6 val from dual)
    -- end of mockup of table "my_tab"; see SQL below...
    select trunc(dt, 'mm') dt, sum(val)
    from   my_tab
    group by trunc(dt, 'mm')
    order by trunc(dt, 'mm');
    DT          SUM(VAL)
    01-MAR-09         22
    01-APR-09         11
    01-MAY-09          6

  • How to compare group level value

    Hi all,
    I have prepared a very simple report like :
    Group A:                60(maximum of this group A)
    a1                          40
    a2                          60
    a3                          20
    Group B:                      53
    b1                                46
    b2                               47
    b3                               53
    GroupC:                  89
    c1                              89
    c2                                87
    c3                               76
    now i want to display the max value between (group B and group A )+  (value of group C) in a cell.
    Thanks in advance

    Hi,
    I think you will need to create a variable that excludes items in group C.
    v_GroupC_excluded.
    =if([Group]="C";-9999;[value])
    then create a second variable with report contexts
    v_MaxValue
    =MAX([v_GroupC_excluded] In Report)
    This can then be added to value when the group is C.
    I have not been able to test this as I am currently reinstalling, but it should work. Let me know how you get on.
    Regards
    Alan

  • XI R3 Grouping Data Values

    In BO v5 desktop client it was possible to create variables that grouped data values.  E.g. if there was a postcode object, you could create a 'Post Code Area' variable to group all post codes that started 'CH', all postcodes that started 'L', etc. and replace the postcode object with the new variable so that only the values CH and L appeared in the report rather than CH1, CH2, CH3, etc.
    Is it possible to do this in XI R3 WebIntelligence?  Or Webi Rich Client?  I've searched the help, this forum and Googled but can't find any reference to it at all.
    Regards,
    Anne.

    Hi,
    if I understand correctly you would like to be able to create sorts of classes for variables within a Web Intelligence document as it was possible in legacy versions
    This is not possible and seems a quite interesting feature that you can suggest at  [https://ideas.sap.com  ]  where you can have your voice and other users can vote,  I suggest to post here the link to your idea so it can get additional votes...
    Thanks!
    Best regards,
    Simone

  • Display "group name" values and their average formulas (calculation of average age) on a single line or row

    <p>I have four groupings, Domain, Area, Priority (3rd level of grrouoping) and then Problem ID. Priority group could have values such as &#39;1&#39;, &#39;2&#39;, &#39;3&#39;, &#39;4&#39; and &#39;5&#39; with corresponding "average" age formula on these group level. values.</p><p>Example:  1         Avg Age= 30</p><p>               2         Avg Age= 45</p><p>               3         Avg Age= 69</p><p>Reguirement:  Display group name values and their corresponding average formula on a single line/row.</p><p>Sample Solution:   Priority 1 = 30, Priority 2 = 45, Priority 3 = 69 </p><p> ***solution above should be displayed/concatenated on one line.</p><p>Your help is greatly appreciated, thank you in advance.</p>

    So right now - your report looks like this
    GroupHeader 1
       GroupHeader 2
           Priority 1 = 50         (actual display of Group 3)
           Priority 2 = 75         (actual display of Group 3)
           Priority 3 = 45         (actual display of Group 3)
           Priority 4 = 9          (actual display of Group 3)
           Priority 5 = 8          (actual display of Group 3)
    And you want to change that so that it displays horizontally.
    If there will only ever be 5 priorities, I think I would cheat the system a bit.  Create a formula that runs at the group 3 level and dumps the values into 5 separate variables (formula below).
    Then create 5 separate display formulas and put them in Group Footer 2 (if you already have a GF2 - then create a second one and move it above your current GF2).  Suppress the G3 section and you should be close to what you are after (unless you also have detail sections, then we'll need to revisit).
    This could also be accomplished with a multi-column subreport at the G2 or G3 level if you need more flexibility.
    formula *******
    numbervar priority1;
    numbervar priority2;
    numbervar priority3;
    numbervar priority4;
    numbervar priority5;
    if {DB.Priority} = 1 then priority1:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 2 then priority2:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 3 then priority3:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 4 then priority4:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 5 then priority5:= {@avgGroupPriorityAvgAge}

  • Prompt Group Text value for parameter that has cascading prompts.

    <p>Does anyone know how to get a Prompt Group Text value for parameter that has cascading prompts. C# sample would be great.</p>

    Hi Sateeesh,
             I delete main memory, but does not work. if I display prompt value in list box, it shows as text value, but in 'query prompt selector', it shows as key value. I am using SAP BO 4.0

  • Read-only radio group losing value on validation error

    It took quite a while to track this down, but I think I've got it narrowed down properly. I have an APEX form for updating a record in a databse table with a radio group which is conditionally read-only. If that radio group has a value AND is read-only, when the form is submitted and hits a validation error, the value of the radio group is lost.
    For example, the radio group SUBMITTED_FOR_APPROVAL is set to Y and is read-only for a given user. That user then changes something else on the form and submits it. However, the form now hits a validation error for some field. When the form reloads with the validation error displayed, all the fields are restored except the read-only radio group which is now blank. If a select list is used with the identical read-only condition, it works fine. Likewise, if a radio group is used, but the read-only condition is removed, it works fine. It is only when it is a radio group and it is read-only, that the value does not appear to be submitted to the session with all the form values whent he form is submitted.
    Is this a bug or am I simply missing something?
    Apex 3.1.2
    Rgds/Mark M.

    It's using a shared component LOV cleverly called LOV_YN which consists of a static LOV with
    1 Display=Yes, Return=Y
    2 Display=No, Return=N
    The settings in the LOV section on the item iteself:
    Named LOV: LOV_YN
    Display Extra values: No Dynamic translation: Not translated
    Number of columns: 2 Display null: No
    Null display value is blank as is null return value
    Item was setup as a radio group and was only converted over to a select list to work around this issue. Let me know what else you need and thanks again.
    Rgds/Mark M.

  • How can I display Group By-Value in the Bex Report

    I have a report values looks like below,
    Month         BALANCE
    04/2005         $ 188.00
    11/2005         $ 188.00
    11/2005         $ 180.00
    12/2005         $ 194.00
    12/2005         $ 196.00
    01/2006         $ 182.00
    01/2006         $ 376.00
    02/2006         $ 184.00
    02/2006         $ 192.00
    I am expecting the results
    Month         BALANCE
    04/2005         $ 188.00
    11/2005         $ 368.00
    12/2005         $ 390.00
    01/2006         $ 558.00
    02/2006         $ 376.00
    Group by Month .(not a result value)
    Please advise on this.
    Advance Thanks

    Rows  - Calendar Year/Month
    Keyfigure Structure in the Column
    The below fields are in the column
    BALANCE
    No.Of .Days
    0-30 days
    31-60 days
    Still I am getting the value
    04/2005           $ 94.00
    11/2005          $ 94.00
              $ 90.00
    12/2005          $ 97.00
              $ 98.00
    01/2006          $ 91.00
              $ 188.00
    02/2006          $ 92.00
              $ 96.00
    Balance needs to Sum /group according to the date value.
    01/2006 has value 91 and 188.I am expecting 279 .
    Please provide some tips.Thanks for help.

  • Set Radio Group Default Value Based on a Select List Change Event

    Apex 4.2
    I have a radio group that is source is below. It returns 3 radio group item All,Miv,Courier
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      ORDER BY 1
    The radio group is only populated when :P320_DEPOT gets a value, this is a select list.
    I am trying to set the radio group to  default to this value Miv it would use the statement
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      and type ='Miv'
      ORDER BY 1
    I have tried creating a dynamic action on Select list change to populate the default value of the radio group...no joy I also tried a computation. how can I set this default value on when list changed.
    Thanks
    I have got the default Radio Group Selection working by doing a computation before region on the radio group and calling its select statement and setting the value. But the problem is now I cannot change the radtio group as I do it fire the before region trigger and sets it back to the default value....any help?

    Hi,
    Could you please create example to apex.oracle.com?
    Regards,
    Jari

  • How to modify person or group field value with new value

    Hi
    I have person or group field having property Person Only.
    Thsi firls already have one value. Now I want to update it but this code to update value is not working.
    string myName = @"ABC\myname";
    web.EnsureUser(myName);
    SPUser myUser = web.SiteUsers[myName];
    SPFieldUserValue myNamevlaue = new SPFieldUserValue(web, myUser.ID, myUser.LoginName);
    oSplistItem["My_x0020_User"] = myNamevalue;
    oSplistItem.Update();
    I am getting myNamevalue correct in the veriable. But why its not updating in the list?
    is there any issue in the above code?
    Do I need to delete previous value and then update new value in this field? How?

    Hi,
    The format of the user value in people/Group field must be
    ID;#Name, you can use the following code snippets to update the people/group field.
    string loginName = "ABC\\myname";
    SPUser user = web.SiteUsers[loginName];
    SPList list = web.Lists.TryGetList("ListName");
    if (list == null)
    Console.WriteLine("list is not exist!");
    return;
    SPListItem item = list.GetItemById(3);
    item["My_x0020_User"] = user.ID.ToString() + ";#" + user.Name;
    item.Update();
    Thanks,
    Jason
    Please remember to mark the reply as answer if it help, and unmark the answer if it provide no help.

  • Need help in grouping data Value.

    Hi Techies,
    I have a requirement where i need to group the rating acording to issuer country and show the aggegated data value in the report.
    Country
    Rating
    Value
    US
    A
    324
    US
    AA
    43
    Europe
    C
    8
    Canada
    A
    34
    Here in the below tables we are showing aggegated data for US . We are having 2 ratings for US so we grouped together and showing it in the one row .
    Country
    Rating
    Value
    US
    A/AA
    367
    Europe
    C
    8
    Canada
    A
    34
    Please suggest if we can achieve this in webi.

    Hi Harpreet,
    Create a variable for count of ratings,
    =count([RATING])
    Create a another variable for rating
    =If [COUNT]=2 Then "A/AA" Else [RATING]
    Regards,
    Samatha B

  • Grouping field value in the additional data tab is saved with capital lette

    Hi,
    Whenever I change the value in the 'Grouping field' in the additional data tab, it gets saved with all letter caps.
    For e.g, if i enter 'Manager'.. it gets saved as 'MANAGER'.
    what could be the reason for this? Is there any configuration for this?
    Regards,
    Simmi

    Hi Simmi,
    For Grouping and Search Field, this seems to be the standard system behaviour in cProjects and as per my knowledge there are no settings for the same.
    Probably you can raise an OSS message regarding the same.
    Regards,
    Vivek Pandey

Maybe you are looking for

  • Can Burn Ripped Music, Can't Burn Purchased Music

    Help!! Ever since installing 7.0.2 I can no longer burn purchased music to CD. Music I ripped from my own CDs burns just fine. Data from desktop burns fine as well as music from other programs such as sonic and Windows Media Player. Actually iTunes w

  • Help with iTunes library on external hard drive

    Hi! I have a new computer and I don't want to put anything in it but the programs I need. When it comes to movies, music, etc. I have an external hard drive. Now, I want my iTunes to read the music from that hard drive, and, when I download something

  • Message: "iTunes Libary.it" cannot be read...

    Help... Since removing Itunes7 and reinstalling iTunes6 due to my Ipod no longer being recognised and all the associated problems with it, I cannot start Itunes6 with the following message appearing: "iTunes Library.it" cannot be read because it was

  • Help Required on Crawling Database

    Hi Experts, I am working in a Web-based Environment on Windows 2003 R2 and Oracle 9.1. For the past some time, I have been experiencing a crawling Oracle database. The reports which used to take a few seconds are now taking minutes. The users are not

  • User exit: sales order  VA01: Customer number

    Hi friends, While creating Sales order, before saving the document, I need to check the Customer (Sold to pary?) details in KNEX table. KNEX-KUNNR KNEX-TDOCO KNEX-DHRCO. if condition fails, I need to display an error message V1525, which should conta