Grouped output required based on input group :No one???????

Hi to all,
I want grouped output based on input group.
e.g
SQL> select * from test_data;
FIELD
a
b
c
d
e
a
e
c
d
e
10 rows selected.
SQL>
Now I want grouped output like this
When I give input set (a,b) then output should be :
a,b
a
c
c
d
d
e
e
e
When I give input set (a,e) then output should be :
a,e
a,e
b
c
c
d
d
e
I want a query regarding this , I know this is possible through Pl/SQL, but the requirement is through query.....
rgds,
Rup

I want grouped output based on input group.
I want a query regarding this
with
test_data as
( select substr(p, instr(p, ',', 1, level) + 1, instr(p, ',', 2, level) - instr(p, ',', 1, level) - 1) as field
    from (select ',' || 'a,b,c,d,e,a,e,c,d,e' || ',' as p from dual)
    connect by level <= length(p) - length(replace(p, ',')) - 1
input_set as
( select distinct substr(p, instr(p, ',', 1, level) + 1, instr(p, ',', 2, level) - instr(p, ',', 1, level) - 1) as field
    from (select ',' || 'a,d,e' || ',' as p from dual)
    connect by level <= length(p) - length(replace(p, ',')) - 1
group_count as
( select min(count(i.field)) as group_cnt
    from test_data t, input_set i
    where i.field(+) = t.field
    group by t.field
    having count(i.field) > 0
test_data2 as
( select field,
      row_number() over (partition by field order by null) as group_no1,
      row_number() over (                   order by null) as group_no2
    from test_data
input_set2 as
( select field, row_number() over (order by field) as item_no
    from input_set
select max(fields) as fields
  from
  ( select
        replace(sys_connect_by_path(decode(level, 1, group_no2), '-'), '-') as group_no,
        ltrim(sys_connect_by_path(t.field, ','), ',') as fields,
        level as lvl
      from test_data2 t, input_set2 i, group_count
      where i.field(+) = t.field
      start with group_no1 > group_cnt or item_no = 1 or item_no is null
      connect by prior group_no1 <= group_cnt and group_no1 = prior group_no1 and item_no = prior item_no + 1
  group by group_no
  order by max(lvl) desc, fields
FIELDS
a,d,e
a,d,e
b
c
c
e
6 rows selected.

Similar Messages

  • How to find groups in domain based on input file of groups

    Hi,
    I want to find if groups exist in the domain based on a list of groups in a text file as follows.  My Get-AdGroup doesn't work, so Im looking for suggestions.
    $MyGroups = Get-Content -path c:\MyGroups.txt
    Foreach ($Group in $MyGroups)
                Get-Adgroup -filter 'Name -like "$Group"' -SearchBase "DC=MyDomain,DC=Com" -SearchScope SubTree
    Thanks in advance.
    Thanks for your help! SdeDot

    One additional suggestion - you need wildcards too, if you really want to use -like:
    Get-ADGroup -Filter "Name -like '*$group*'"
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Determine output filename based on input filename content with RFC lookup

    Hello Guys,
    I have this sitaution which needs your ideas/sugestion.
    1)  PI system picks up text file from FTP server folders.
    2)  Within PI system,  we need to dynamically determine output filename , logic to determine output filename will be :
              2a)  Read content of the input file particular line number  (Fixed)
              2b)  Pass the value got from step 2a)  to the Remote function module passing value read in step 2a) to get response
              2c)  Use response received from 2b) to construct output filename.
    Please let me know if you have any qeustions on my problem,  appreciate your ideas/suggestions.
    Thanks,
    Krishna

    Hello Priyanka,
    THanks for your response to my post.
    My input  TEXT filename has following contents
    :20:CHASGB2LXXX
    :25:24803501
    :28:11264/01
    :60F:C110921USD85410,88
    :61:110921C12307,00NTR NONREF//5311802
    :86:TR ?
    ?20IV.2000199238 FR.26.08.11 IV.2000198595FR.22.08.11
    ?23AZMAT20091123183
    Now  I would like to read second row of this TEXT file containing   ":25:24803501"   and would like to read only text
    24803501.
    Hope this additional info will provide me more info on my requirement.  Appreciate your response.
    Regards
    Krishna

  • Multiple Output XML based on input

    I want to have multiple outbound files based on the contents of the input file.  For instance, in the example below, I want to have multiple outputs based on Report_ID.
    So I would have Output 1 with Report_ID of 001 (With 2 lines), Output 2 with Report_ID of 002 (With 1 line), Output 3 with Report_ID of 007 (With 1 line) and Output 4 with Report_ID of 009 (With 2 lines).
    - <ns:INB xmlns:ns="...">
    - <EXPENSES>
    - <EXPENSE_LINES>
      <EMP_ID>TUUK1</EMP_ID>
      <Report_ID>001</Report_ID>
      <Value>7</Value>
      </EXPENSE_LINES>
    - <EXPENSE_LINES>
      <EMP_ID>TUUK1</EMP_ID>
      <Report_ID>001</Report_ID>
      <Value>3</Value>
      </EXPENSE_LINES>
    - <EXPENSE_LINES>
      <EMP_ID>TUUK1</EMP_ID>
      <Report_ID>002</Report_ID>
      <Value>25</Value>
      </EXPENSE_LINES>
    - <EXPENSE_LINES>
      <EMP_ID>TUUK1</EMP_ID>
      <Report_ID>007</Report_ID>
      <Value>6</Value>
      </EXPENSE_LINES>
    - <EXPENSE_LINES>
      <EMP_ID>TUUK1</EMP_ID>
      <Report_ID>009</Report_ID>
      <Value>63</Value>
      </EXPENSE_LINES>
    - <EXPENSE_LINES>
      <EMP_ID>TUUK1</EMP_ID>
      <Report_ID>009</Report_ID>
      <Value>3</Value>
      </EXPENSE_LINES>
      </EXPENSES>
      </ns:INB>

    You have to use Multimapping here.
    for that create a Message mapping and switch to the signature tab ,change the Occurence of target Message Type to 0..unbounded.
    Assign the Mapping as follows
    Report_ID(Change the Context to Expences)-->splitByValue(value Change)-->collapeseContext--->TO THE Target Message Type
    Report_ID(Change the Context to Expences)---> splitByValue(value Change)----->collapeseContext--->SplitByValue(ValueChange)---to the Target Report_Id.
    EMP_ID(Change the Context to Expences)---> splitByValue(value Change)----->collapeseContext--->SplitByValue(ValueChange)---to the Target EMP_Id.
    Value(Change the Context to Expences)------------------------------------------------------\
                                                                                    formatByExample-----To the TargetValue
    Report_ID(Change the Context to Expences)-->splitByValue(value Change)---------------------/
    this works fine if the Values are coming in the Order otherwise you also have to use Sort and SortBy Key functions.
    It will be better if you provide the target structure to provide the exact mapping with the target fields
    Edited by: Kubra fatima on Jun 23, 2010 3:32 PM

  • Make a field required based on input in another field

    So I have researched the forum to answer the question of how to make certain fields in a form required if a value is entered in another designated field, and not required if no value is entered in the designated field.
    For example:
    There is a field titled QTY_paper, and if a value is entered into QTY_paper, then the field PROGRow1 should become required.
    If no value is entered into QTY_paper, then PROGRow1 is not required.
    I've tried both FormCalc and Javascript, but with no results. In FormCalc I added this script as a mouseExit event on QTY_paper:
    if ($.isNull == 0) then
         //Make the budget field Required
         PROGRow1.validate.nullTest = "error";
    endif
    and then I added this script in FormCalc to the mouseExit event on PROGRow1:
    if ($.isNull == 0) then
    $.validate.nullTest = "disabled"
    endif
    This came almost verbatim from another post on the forum, so I'm thinking I'm missing something obvious here... which isn't too odd as I'm still pretty new at adding the scripts. Please help if you can!

    You'd want to combine both scripts on the first field with an if/else statement. And I'd use the Exit event instead of Mouse Exit (not sure if Mouse Exit handles tabbing in and out of fields).
    The first script should have worked, but with the second script you were asking if PROGRow1 was null, not QTY_paper.
    FormCalc:
    if ($.isNull) then
         PROGRow1.validate.nullTest = "error"
    else
         PROGRow1.validate.nullTest = "disabled"
    endif

  • Viewing the mrp run output based on mrp groups

    Hi, please advise how to view the mrp run result based on mrp groups? also advise how to run mrp on the basis of mrp groups?
    thanks.

    Hi,
    Can you use MRP Controller instead MRP Group. Because you have option to view MRP result by MRP Controller in MD05.
    And you can execute MRP based on MRP Contoller by using user exit M61X0001 in MD01.
    Regards,
    Vishal

  • Derivation of fund center based on purchasing group

    Hi,
    It is required to determine the fund center based on purchasing group (during PR creation). I  have gone through one thread which suggests inclusion of the field EKGRP into FMDERIVE, then to COBL.
       However I was trying to check whether it can be done through table lookup using field USERTEMP1 and assigning the same to EKGRP. But in the table lookup screen, the upper part contains the fields BANFN (Purchase Requisition Number) and BNFPO (Item Number of Purchase Requisition) which need to be assigned to source fields. I am not sure what source fields should be assigned and how it will  work.
    Request your input in this regard.
    Thanks in advance!
    Snigdho.

    Hi,
    I am trying to derive fund center based on purchasing group using field USERTEMP1. In the upper part of table lookup screen (I am using table EBAN) what should I assign to the fields BANFN and BNFPO?
    Thanks
    Snigdho

  • What is B2B setup for grouping transaction sets based on criteria.

    Hi,
    Oracle B2B offers a time bound Batching feature . However to handle following case such as Batching based on Order Number it is required to define the criterion.
    Could you please provide the information on B2B Setup for grouping transactionsets based on input parameter(Invoice id OR Invoice Number or Payment ID ) passing from back end application(BPEL) to B2B.
    For count based batching , my understanding is need to pass information in the format " <BatchMode>:<BatchID>:<Count>:<timeout>:" by parameters delivered with the IP_MESSAGE_TYPE construct. Which paramter of IP_MESSAGE_TYPE construct I have to use for passing the values to B2B in the format " <BatchMode>:<BatchID>:<Count>:<timeout>:"
    I am unable to find Action name attribute of IP_MESSAGE_TYPE construct to pass the values. Please provide the required information.
    Thanks&Regards,
    Sridhar.Rachumallu.
    Edited by: sridhar.rachumallu on Sep 7, 2010 11:06 AM

    Hi Anuj,
    Thanks for the information.
    ACTION_NAME attribute is not available with SCA. Three channels (Default,AQ,JMS ) are provided in B2B adapter for connecting to B2B. Which one supports action_name attribute?
    Design Time:
    Presently by using 'Default' channel of B2B adapter i am connecting to B2B. I am unable to pass the value for b2b property "ACTION_NAME" because invoke activity does not has respective sca normalized message propertie "b2b.actionName". So i am adding input property tab in .bpel file under corresponding B2B Adapter invoke tag as given below.
    <invoke name="Invoke_Put3070EDI820"
    inputVariable="Put3070EDI820_InVar"
    partnerLink="Put3070EDI820"
    portType="ns1:B2B_send_ptt" operation="send">
    <bpelx:inputProperty name="b2b.toTradingPartnerId"
    variable="Variable_TargetTPartner"/>
    <bpelx:inputProperty name="b2b.fromTradingPartnerId"
    variable="Variable_SourceTPartner"/>
    <bpelx:inputProperty name="b2b.documentTypeName"
    variable="Variable_TransactionSet"/>
    <bpelx:inputProperty name="b2b.documentProtocolVersion"
    variable="Variable_EDIVersionNo"/>
    *<bpelx:inputProperty name="b2b.actionName"*
    variable="Var_B2Baction"/>+
    </invoke>
    Defined variable ' Var_B2Baction' as string and assigned the expression as "concat('D:',bpws:getVariableData('Var_B2BBatchID'),':2:60')" and composite instance id expression "ora:getCompositeInstanceId()"mapped to 'Var_B2BBatchID' in BPEL.
    Run time :
    In application message of B2B coming the value as "b2b.actionName=D:608469:2:60". Here count coming as 2 but B2B is not grouping 2 transaction sets.Creating one EDI file for one transaction set.
    Why B2B is not considering incoming value "b2b.actionName=D:608469:2:60" for batching the transaction sets.
    Please suggest me the correct approach if i am wrong.
    Thanks&Regards,
    Sridhar.Rachumallu
    Edited by: sridhar.rachumallu on Sep 8, 2010 4:24 AM
    Edited by: sridhar.rachumallu on Sep 8, 2010 4:25 AM
    Edited by: sridhar.rachumallu on Sep 8, 2010 4:27 AM
    Edited by: sridhar.rachumallu on Sep 8, 2010 4:27 AM

  • ACS 5.3 Group Mapping based on AD group membership

    Hi,
    I am configuring a new ACS 5.3 system. Part of the rules is that I want to match the users specific AD group membership, and match appropriatly to an identity group.
    What i'm trying to do is say that if the user is a member of the AD Group (G-CRP-SEC-ENG) then associate them with the Identity Group SEC-ENG. The under the access service, authorization portion, i assign shell profiles and command sets based on Identity Group.
    It seems that the ACS server will not match the AD Group for the user, and it will match the Default of teh Group Mapping portion of the policy every time.
    I tried several configuration choices from : AD1:ExternalGroups contains any <string showing in AD>, AD1:memberOf <group>.
    Is there something special i need to do in the Group Mapping Policy to get it to match and active directory group and result in assigning the host to an Identity Group?
    Thank you,
    Sami

    Ok, my case is like this.
    I use ACS 5.3 for VPN authentication, using AD and an external RSA for token authentication (2 factor authentication)
    I didn't add all the VPN users in the ACS, because it will be troublesome, the users authentication will be managed by AD and RSA server.
    In some cases where we need to restrict a group of user to only access certain resources, downloadable ACL is used.
    Following the Cisco docs, i manage to get downloadable ACL works when the authorization profile matching criteria is username, but when i change the matching criteria to Identity group, the downloadable ACL won't work.
    I have a case with Cisco engineer now and still in the middle to sort things out.
    The advice from the Cisco engineer is to have the Access Service set to Internal User instead of RSA server, but that will require us(the admin) to import all the VPN users into the ACS database.
    Wondering whether there is a fix for this.
    Thanks.

  • PO Qty restruction based on purchase group

    Hi experts
    Can you provide me solution on this requirement that restruction on purchase order qty based on purchase group,
    in detail my user want that if i entered purchase group XYZ ,then for that purchase order po qty system should not allow more than 1 qty for 1234 company code .
    is there any solution for this requirement
    Kumar

    Hi,
    Can you please elaborate? The purchase group is on the Header of the PO. When you say that the quantity needs to be restricted to only 1, does that mean that only one item is allowed on the PO with Qty 1 or multipel items are allowed but each of the items can have quantity as 1?
    Also, the exit ME_PROCESS_PO_CUST is active only in the online mode for ME21N and ME22N. If you have any background jobs generating a PO (Planning ME59N etc.) the exit does not work.
    Regards,
    Naveen

  • How to change the values in custom profiles based on security group ??

    Hi,
    i am facing problem for my requirement, can anybody help me for below scenario...
    i have custom check in profiles , there are content types and sub types. sub type nothing but a categories on for particular content type. For example i have News content type , same in the below subtypes drop down list are press release, events, articles etc.
    what i want to do is, when i open custom checkin profile, subtype values need to be changed( some values in subtype should hide) based on security group changes .
    In the Sub type listed values, some values need to hide only when i choose different security groups.. sub types values should display based on the particular security group only. when ever i change the security group, drop down Values in subtypes needs to change.
    hope understand my requirement.
    How to achieve this task. Any help would be greatly appreciated.
    Thanks,
    yt

    Hi,
    Thanks alot. its working fine
    Can we configure DCL Relation two times in one information filed ??? i should not create not more than fields to this requirement.
    Type -> subtype = DCL already existed
    Now, i want to Create DCL to
    Subtype ---> Security group
    As per my requirement, if i change the security group in checkin form, values should be change in the SubType drop down list.
    Created checkin profile there was DCL relation to " Type and "Sub Type" . now i want to map Relation ( DCL ) for subtype to security group.
    i was trying do for DCL for subtype and security group. but there was already existing DCL created for subtype information field (Relation configuration done for content type). even though i was trying to do for DCL in Security group information field. but, i could not find security group information field in configuration manager.
    Now what should i do ?? how to create DCL to subtype and security group ??
    Help would be appreciated.
    yt

  • Commision based on item group & customer group

    Dear all,
    Does anyone have an idea about how to get commission based on item group & customer group sales?
    My customer wanted commission report based on item group or customer group & based on payment collection dated.
    Example
    Term given for customer A is 30 days.
    12/3/09 Inv 1000   RM 10,000   30 days payment
    20/4/09 Inv 2000  RM    5,000   60 days payment
    The term given is 30 days of the invoice month.
    Salesman will get commission if get the collection at May'09 for Inv 1000, & July'09 for iinv 2000 based on the invoice date month.
    The salesman get commission at any date of the month May'09. More longer collection, less commission they will get.
    Example:
    Salesman A
    Customer Group             1st of the month, 2nd of the month, 3rd of the month, 4th of the month
    Normal Dealer                         1.5%         ,  0.75%,              0.00%                   ,    -0.25%
    Sub Distributor                       0.5%         ,  0.25%,               0.00%                  ,    - 0.25%
    Any idea?
    Thanks in advance?
    Regards,
    Eric Tan

    Hi Eric
    SAP does not calculate commissions, but merely provide a mechanism to report on it. The multi level calculation you require can be achived with a custom query linked to a report layout. Standard SAP will not provide this type of calculation. You will need to look at the open transactions such as invoices and link to the relevant payment transaction to get the payment date. Then compare this date to the invoice due date to determine if the terms were adhered to or not. If not payment date - due date in number of days will be needed to calculate the effective commission percentage.
    Kind regards
    Peter Juby

  • PO release strategy based on Material Group (CEKKO - MAKTL)

    Hi Experts,
    I have configure the Rel strategy based CEKKO-MATKL (material group) for purchase order, but when i raise the PO Rel strategy is not affecting, Can any body tell me why.
    Regards,
    Kumar

    You can set Release strategy based on Material group & other Line item specific fields..
    You better follow a suitable and hinder less process..
    For PR use Material group & Account Assignment based Release process..
    then for PO use a Release Process based on Header level fields like Doc type, Amount, pur Group etc..
    So that the approved PR line can be converted into PR and then the PO also subjected to Release before sending it to External Vendor..
    Even if you want you can make that the PO can not be created without referencing PR for SOme users or All users..
    based on your business requirement..

  • Users based on Portal Group

    Hi all,
    Is there any table or RFC which contains the Users based on Portal Group in ECC.I need to writa a programme which extracts the users based on poratal group.
    Thanks and Regards,
    Venkat

    Hi Venkat,
    To get users of a group:
    boolean b =false;
    String name = null;
    IGroup grp = UMFactory.getGroupFactory().getGroupByUniqueName("GroupName entered by User as a input");
    if(grp.equals("<Name of Group>"))
           Iterator i = grp.getUserMembers(true);
           grp.getGroupMembers(true);
           for (int a= 0; i.hasNext(); a++)
                  name = i.next().getClass().getName();
                  //Print / Store Name
    Regards,
    Vaibhav

  • [Authorization] Entry Qty Based on Material Group

    Dear gurus,
    I've requirement like this:
    In tx. VL02N, in picking tab, picked qty can only be entered by personnel based on material group (there's material no. in that screen, and can be traced to get material group).
    Is it possible?
    Regards,

    Hi,
    Is it possibl?

Maybe you are looking for

  • Apps tab missing from Creative Cloud Desktop

    Hello and thanks in advance for any help you can provide. I'm running Creative Cloud on Mac OS 10.9.5. A couple days ago I updated several of the apps through the Creative Cloud Desktop app in the menu bar. The apps updated and they all seem to run f

  • Designer 7.0  form working with Reader 7.0.5 but not Reader 7.0.8

    Hello everyone, I was wondering if anyone has had a problem with a formed created using Designer 7.0 that was working with Reader 7.0.5 but no longer functions with Reader 7.0.8? The form consists of a numeric textbox N1 and 2 checkboxes C1[0] and C1

  • Unable to commit a transaction Using Oracle

    Hi all, I have created a JDBC System using the following link. http://help.sap.com/saphelp_nw04/helpdata/en/ab/082484173ae045ab8dad8a41d33da3/frameset.htm The JDBC Datasource is working absolutely fine , in my database actually autocommit is off , so

  • Oracle Client install problem on Solaris8(relink errors)

    I tried to reinstall the Oracle client. I am getting errors like the following: Error in invoking target relink of makefile ins_precomp.mk, and a whole bunch of other mk relink errors. I kept ignoring them. And finally the installer reported the foll

  • HP Software - photo printing

    I used to have a HP Inkjet 932C and All-In-One 2170 and the HP software that came with it allowed you to print multiple size photo prints on a 8.5"x 11".    For example, I want to print out three (3) 5"x7" photo prints on an 8.5"x11", or ten (10) wal