Report of Groups owned along with group memberships for each group, all in a single .csv file

Hello all,
What I'm trying to do is generate a report of all groups owned by a specific user, along with the group memberships, and output it all to a single .csv file. In the .csv file, I would like to have the group names as the column headers, and underneath
the group name, list all the members of the group down through the column. So for example, if User1 owns 3 groups, the output would look like:
What I'm having trouble with is outputting the objects to the .csv using New-Object psobject, and I'm starting to wonder if there is an easier way to do this and my brain is just fried.
Any ideas?

OK so I can try and give some code here, but I'm asking more of a concept question about how PowerShell builds objects so I'm not sure it will help....
$User = "User1"
get-adgroup -filter {managedby -eq $user} -pr member | %{
$_.name
$_.member
OK so this is a simple script that outputs a group name followed by the membership, all in a single column. What I would like is for the group names to each be the header of a column, and have the membership listed underneath. For example:
Is this possible in PowerShell?

Similar Messages

  • Report on Open Items along with Qty & Value for LA confirmed items

    Hi,
    I would like to know a report of Open POs(No Goods receipt made) but LA confirmed Items along with Values(Amount)
    i.e
    List of confirmed,unsent items along with Values for plant wise or vendor wise or PO Number wise.
    Regards,
    Vengat

    Hi,
    Any other inputs?
    Our client's requirement is to know how many (Both Qty & Value) of items for the input LA confirmed(ASN received) but no GR Made
    Regards,
    Vengat

  • Display group by field value only once for each group

    I have a table with following fields:
    TicketNo (varchar2)
    TName (varchar2)
    DateIssue (Date/Time)
    I wanto retrieve result in the following form:
    DateIssue TName TicketNo
    01-oct-2006 ABC 123-7733
    DEF 545-54454
    GHI 254-4545
    02-oct-2006 JKL 454-7897
    MNO 444-7878
    TName and TicketNos must be grouped by DateIssue. Since "Group By" clause uses agregate functions only, therefore this type of query will not run:
    SQL> Select DateIssue,TName,TicketNo from Table1 group by DateIssue order by DateIssue;
    How to display the above given result?

    SQL> select * from tickets;
    TICKETNO   TNAME      DATEISSUE                                                
    121-565    abc        04-FEB-07                                                
    454-hj     def        04-FEB-07                                                
    4545-856   gftr       03-FEB-07                                                
    fg45-856   gth        03-FEB-07                                                
    SQL> select decode(row_number() over(partition by to_date(dateissue) order by ticketno),1,dateissue) dateissue
      2         ,tname,ticketno
      3  from tickets;
    DATEISSUE TNAME      TICKETNO                                                  
    03-FEB-07 gftr       4545-856                                                  
              gth        fg45-856                                                  
    04-FEB-07 abc        121-565                                                   
              def        454-hj
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Count() for each group, but only groups having 1+ element like... AND all elements like...

    There are tables(and columns) like:
    'Clients'(clientID)
    'Houses' (houseID)
    'Visits' (clientID, houseID, visit_date)
    'Contracts'(contractID, houseID, clientID, rentDate_from, rentDate_end)
    I have problem with writing MS SQL query of this kind:
    how many visits to houses did each client, before renting one of them?
    Its easy to count total number of Visits for each client, listing all visits + group by clientID and selecting count(*) for each group.
    Lets say this is select_1, and select_2 is listing all Contracts for all clients.
    Select_1 is not answer, because count must be performed only on groups, which:
    -have at least 1 row "like" row in select_2 (it means that at least one of visited houses was rented, because it can happen that client visited few houses, but rented other, not visited house). my idea for this is comparing select_1 and select_2 with:
    "where s1.clientID=s2.clientID and s1.houseID=s2.houseID"
    -each group must have all rows(visits) with date of same day or earlier than contract date
     maybe: "datediff(day, s1.visit_date, s2.rentDate_from) >= 0"

    In future, please provide proper DML, DDL and example data, like I have for you below.
    DECLARE @clients TABLE (clientID INT, name VARCHAR(20))
    INSERT INTO @clients (clientID, name)
    VALUES (1, 'Jonathan'),(2, 'Christopher'),(3, 'James'),(4, 'Jean-Luc'),(5, 'William')
    DECLARE @houses TABLE (houseID INT, address VARCHAR(20))
    INSERT INTO @houses (houseID, address)
    VALUES (1, 'NX01'),(2, 'NCC 1701'),(3, 'NCC 1071A'),(4, 'NCC 1701D'),(5, 'NCC 1701E')
    DECLARE @visits TABLE (clientID INT, houseID INT, visitDateTime DATETIME)
    INSERT INTO @visits (clientID, houseID, visitDateTime)
    VALUES (1,1,'2001-01-01 12:13:14'),
    (2,2,'2001-01-02 12:13:14'),
    (3,2,'2001-01-01 12:13:14'),(3,3,'2001-01-01 12:13:14'),
    (4,4,'2001-01-01 12:13:14'),(4,5,'2001-01-01 12:13:14'),
    (5,4,'2001-01-01 12:13:14'),(5,5,'2001-01-01 12:13:14')
    DECLARE @contracts TABLE (contractID INT IDENTITY, houseID INT, clientID INT, rentStartDate date, rentEndDate date)
    INSERT INTO @contracts (houseID, clientID, rentStartDate, rentEndDate)
    VALUES (1,1,'2001-01-02',NULL),(2,2,'2001-01-02',NULL),(3,3,'2001-01-02',NULL),(4,4,'2001-01-02',NULL),(5,5,'2001-01-02',NULL)
    SELECT contractID, c.houseID, c.clientID, rentStartDate, rentEndDate, cl.clientID, name, h.houseID, address, COUNT(v.clientID) AS visits
    FROM @contracts c
    LEFT OUTER JOIN @clients cl
    ON c.clientID = cl.clientID
    LEFT OUTER JOIN @houses h
    ON c.houseID = h.houseID
    LEFT OUTER JOIN @visits v
    ON c.clientID = v.clientID
    AND c.rentStartDate >= v.visitDateTime
    GROUP BY contractID, c.houseID, c.clientID, rentStartDate, rentEndDate, cl.clientID, name, h.houseID, address

  • How to compare the value node of a for-each-group with other for-each-group

    Hello!
    I have a report in Oracle BI Publisher (10.1.3.2) with several data set. My XML schema is something like
    <DATA>
    <PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>12345</A_ID>
    <DESCRIPTION>ABC</DESCRIPTION>
    <VALUE>111111</VALUE>
    </MY_PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>12345</A_ID>
    <DESCRIPTION>DEF</DESCRIPTION>
    <VALUE>222222</VALUE>
    </MY_PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>67890</A_ID>
    <DESCRIPTION>ABC</DESCRIPTION>
    <VALUE>333333</VALUE>
    </MY_PARAMETERS>
    </PARAMETERS>
    <NAMES>
    <MY_NAMES>
    <A_ID>12345</A_ID>
    <NAME>ASDF</NAME>
    </MY_NAMES>
    <MY_NAMES>
    <A_ID>67890</A_ID>
    <NAME>EFGH</NAME>
    </MY_NAMES>
    </NAMES>
    <VALUES>
    <MY_VALUES>
    <A_ID>12345<A_ID>
    <VALUE>10987</VALUE>
    <DESCRIPTION>ASDFG</DESCRIPTION>
    </MY_VALUES>
    <MY_VALUES>
    <A_ID>12345<A_ID>
    <VALUE>26385</VALUE>
    <DESCRIPTION>EFGHI</DESCRIPTION>
    </MY_VALUES>
    <MY_VALUES>
    <A_ID>67890<A_ID>
    <VALUE>24355</VALUE>
    <DESCRIPTION>ASDFG</DESCRIPTION>
    </MY_VALUES>
    </VALUES>
    </DATA>
    I'm trying to build a rtf template in Word using this XML schema. The "A_ID" nodes in each group in my data have the same value. I want for each "A_ID" take the respective values in /DATA/VALUES/MY_VALUES.
    <?for-each-group:MY_PARAMETERS;./A_ID?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='ABC'?>
    <?VALUE?>
    <?end when?><?end choose?>
    <?end for-each?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='DEF'?>
    <?VALUE?>
    <?end when?><?end choose?>
    <?end for-each?>
    <?/DATA/NAMES/MY_NAMES/VALUE?>
    <?for-each-group:/DATA/VALUES/MY_VALUES;./A_ID?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='ASDFG'?>
    <?VALUE?> <---------------- I obtain for this node the '24355' and '10987' values
    <?end when?><?end choose?>
    I want to know how to obtain only '24355' value, this is, the value for A_ID (/DATA/VALUES/MY_VALUES) = A_ID (/DATA/PARAMETERS/MY_PARAMETERS).
    Can someone help me?

    CREATE OR REPLACE TRIGGER "TEST_TRG"
       BEFORE UPDATE OF "STATUS"
       ON "TABLE1"
       FOR EACH ROW
    BEGIN
       IF (:NEW.status = 'HOLD')
       THEN
          INSERT INTO table2
                      (status
               VALUES (:NEW.status
       END IF;
    END;You should learn how to write PL/SQL code.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Single row table with for-each group loop to set variable.

    Hi: There is probably a simple answer for this but I have not found it ...
    I have a single row table to loop through a group to set a variable holding a running amount. I am not displaying the amount within the table however when I preview the report I see that the table is expanding (adding rows) for each loop.
    The single row table has 3 columns.
    1st column
    <?for-each:AC_GROUP?>
    2nd column
    <?xdoxslt:set_variable($_XDOCTX,'xAmtVar',xdoxslt:get_variable($_XDOCTX,'xAmtVar')+CURRENT_AMOUNT)?>
    3rd column
    <?end for-each?>
    Should I be using <?for each-group?> or something else. My requirement is to set the value of the variable with the running total but because the loop is adding rows for each value it loops through (even though not displayed), it is moving other areas of the layout off the page.
    Hope this makes sense. Thanks in advance.

    you can do it many ways.
    No need to loop
    You can create a variable and put the sum amount directly in that.
    <?doxslt:get_variable($_XDOCTX,'xAmtVar',sum(/AC_GROUP/CURRENT_AMOUNT))?>or
    loop thru and add like you do.
    <?for-each@inlines:AC_GROUP?><?xdoxslt:set_variable($_XDOCTX,'xAmtVar',xdoxslt:get_variable($_XDOCTX,'xAmtVar')+CURRENT_AMOUNT)?><?end for-each?>do give any space or enter character in word between them, just put this in a single form-field will do
    But as i said, i would certainly go with first option.

  • ?for-each-group? dosen't work with page break - rtf template???

    Hello all,
    When I give a page break inside the for-each-group the group doesn't iterate any code after the page break. I can't give <?split-by-pagebreak?> in this case because I want that loop to be iterated for every department, and should show the report in one column(ms word column), and the department description in two columns.....as this has to happen for every department I can't write separate code........everything should go into one file......
    Final file should look like:
    <for every department>
    <department_report-a table>--one column(ms word column)
    <department_description-a huge text>--two columns(ms word columns)
    <next department>
    how can I achieve this - please help, its urgent.
    Thanks for your time.
    DK

    bipuser thanks for your response
    i will have table data also so i cannot keep in the same line.
    its strange for the last 2-3 days below syntax gave me space at the beginning of each group now it is working i didnt do any change
    <?for-each:G_1?>
    ABCDEFDG
    <?split-by-page-break:?><?end for-each?>

  • Asset transfer report - for-each-group

    - <FAS430>
    - <LIST_G_SETUP>
    - <G_SETUP>
    <COMPANY_NAME>ABCD</COMPANY_NAME>
    <LOCATION_FLEX_STRUCTURE>101</LOCATION_FLEX_STRUCTURE>
    - <LIST_G_ASSET_TRANS>
    - <G_ASSET_TRANS>
    <ASSET_NUMBER>1321780</ASSET_NUMBER>
    <ASSET_DESCRIPTION>CABLES & CONNECTORS</ASSET_DESCRIPTION>
    <TAG_NUMBER>K-PM-B-HCB-3899</TAG_NUMBER>
    <TRANSNUM>3512926</TRANSNUM>
    - <LIST_G_TRANSFERS>
    - <G_TRANSFERS>
    <TO_FROM>0</TO_FROM>
    <GL_ACCOUNT>81216</GL_ACCOUNT>
    <COMP_CODE>118</COMP_CODE>
    <COST_CENTER>000</COST_CENTER>
    <LOCATION>KANNUR CHALODE NONE CHALODE NONE</LOCATION>
    <START_DATE>21-JUL-08</START_DATE>
    <UNITS>-200</UNITS>
    <ASSIGNED_TO />
    <CCID>6705</CCID>
    - <LIST_G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>0</DEPRN_RESERVE>
    <COST>-89983.26</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>-18.96</DEPRN_RESERVE>
    <COST>0</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    </LIST_G_SUB>
    <D_GL_ACCOUNT>81216</D_GL_ACCOUNT>
    <D_COMP_CODE>118</D_COMP_CODE>
    <D_COST_CENTER>000</D_COST_CENTER>
    <D_LOCATION>KANNUR.CHALODE.NONE.CHALODE.NONE</D_LOCATION>
    <D_AS_COST><89,983.26></D_AS_COST>
    <D_AS_DEPRN_RSV><18.96></D_AS_DEPRN_RSV>
    <AS_COST>-89983.26</AS_COST>
    <AS_RESERVE>-18.96</AS_RESERVE>
    </G_TRANSFERS>
    - <G_TRANSFERS>
    <TO_FROM>1</TO_FROM>
    <GL_ACCOUNT>81216</GL_ACCOUNT>
    <COMP_CODE>118</COMP_CODE>
    <COST_CENTER>000</COST_CENTER>
    <LOCATION>KANNUR CHALODE NONE CHALODE NONE</LOCATION>
    <START_DATE>21-JUL-08</START_DATE>
    <UNITS>199</UNITS>
    <ASSIGNED_TO />
    <CCID>6705</CCID>
    - <LIST_G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>18.87</DEPRN_RESERVE>
    <COST>0</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>0</DEPRN_RESERVE>
    <COST>89533.34</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    </LIST_G_SUB>
    <D_GL_ACCOUNT>81216</D_GL_ACCOUNT>
    <D_COMP_CODE>118</D_COMP_CODE>
    <D_COST_CENTER>000</D_COST_CENTER>
    <D_LOCATION>KANNUR.CHALODE.NONE.CHALODE.NONE</D_LOCATION>
    <D_AS_COST>89,533.34</D_AS_COST>
    <D_AS_DEPRN_RSV>18.87</D_AS_DEPRN_RSV>
    <AS_COST>89533.34</AS_COST>
    <AS_RESERVE>18.87</AS_RESERVE>
    </G_TRANSFERS>
    - <G_TRANSFERS>
    <TO_FROM>1</TO_FROM>
    <GL_ACCOUNT>81216</GL_ACCOUNT>
    <COMP_CODE>118</COMP_CODE>
    <COST_CENTER>000</COST_CENTER>
    <LOCATION>KANNUR CHALODE MW BB NONE CHALODE MW BB NONE</LOCATION>
    <START_DATE>21-JUL-08</START_DATE>
    <UNITS>1</UNITS>
    <ASSIGNED_TO />
    <CCID>6705</CCID>
    - <LIST_G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>.09</DEPRN_RESERVE>
    <COST>0</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>0</DEPRN_RESERVE>
    <COST>449.92</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    </LIST_G_SUB>
    <D_GL_ACCOUNT>81216</D_GL_ACCOUNT>
    <D_COMP_CODE>118</D_COMP_CODE>
    <D_COST_CENTER>000</D_COST_CENTER>
    <D_LOCATION>KANNUR.CHALODE MW BB.NONE.CHALODE MW BB.NONE</D_LOCATION>
    <D_AS_COST>449.92</D_AS_COST>
    <D_AS_DEPRN_RSV>0.09</D_AS_DEPRN_RSV>
    <AS_COST>449.92</AS_COST>
    <AS_RESERVE>.09</AS_RESERVE>
    </G_TRANSFERS>
    </LIST_G_TRANSFERS>
    <DPIS>30-JUN-08</DPIS>
    <ASSET_CATEGORY>BT</ASSET_CATEGORY>
    </G_ASSET_TRANS>
    We are trying to use XML Publisher to create an Asset transfer report. The element TO_FROM=0 denotes the From part of the asset transfer, the TO_FROM=1 denotes the To part of the asset transfer.. in this case we have a asset 200 units transfered 199 and 1 to two locations..in out rtf we are getting only the first line i.e.199..we have begin the group by <?for-each-group@section:G_ASSET_TRANS;ASSET_NUMBER?><?variable@incontext:G2;current-group()?>. In the units column we are giving <?$G2/LIST_G_TRANSFERS/G_TRANSFERS[./TO_FROM=1]/UNITS?>
    Edited by: user648077 on Nov 3, 2008 10:26 PM

    Hi Srini,
    Thanks for the help..we got it resolved at out end.. we added another group <?for-each-group:$G2/LIST_G_TRANSFERS/G_TRANSFERS[./TO_FROM=1];LIST_G_SUB?><?variable@incontext:G3;current-group()?> and then used it in the units column...<?$G3/UNITS?>
    Thanks
    Ramanathan

  • Ssrs report export to excel along with parameter filters

    HI,
    In ssrs reports export to excel along with parameter filters,is it possible or not?
    Could you please help me..
    indu

    Hi Sriindu,
    According to your description, you want to export the report into an excel file with the report parameter and filters. And you want to filter data in excel. Right?
    In Reporting Services, the components for exporting report into a file called Reporting Services Rendering Extension. There are three types of Reporting Services rendering extensions: Data Render Extension,
    Soft page-break renderer extensions, Hard page-break rendering extensions. All these three extension are only for rendering data. It can't keep the filters and parameter in the report. Also excel can't support Reporting Services filter in
    an excel file. So your requirement can't be achieved.
    Reference:
    Exporting Reports (Report Builder and SSRS)
    Interactive Functionality for Different Report Rendering Extensions (Report Builder and SSRS)
    If you have any feedback on our support, please click
    here.
    Best Regards,
    Simon Hou

  • OLD Adobe Creative Suit CS3 version Access along with Current Membership

    I have purchased Adobe CC. is it possible, I can keep copy of Adobe Creative Suit CS3 in my PC along with Adobe Creative Cloud ?
    Along with same membership, will I have OLD versions access free ?
    If yes, From where I can download CS3 Suit ?

    To my knowledge there is currently only access to CS6 versions of Creative Suite products if you have a full Cloud subscription.  I don't know/think that they will be offering access to any others.  If older versions do become available as part of a Cloud subscription then they would be downloaded thru the Cloud interface just as the CS6 versions are now.
    Download previous versions of Adobe Creative applications -
    http://helpx.adobe.com/creative-cloud/kb/download-previous-versions-creative-applications. html

  • Reset Page Number for each Group

    I am currently creating a RTF template using XMLP 5.0
    My demanding boss gets back in town in five days, and he expects
    this report to be ready for production. :)
    But I haven't been able to figure out one last spec.
    The page number needs to be reset for each group.
    So for example, the total report is about 83 pages.
    In my RDF file (from Oracle Apps), I am grouping by a DEPT field.
    In my RTF template, I am page breaking on each DEPT.
    The page numbering should also be reset to 1 on each DEPT break.
    The reason for this, is that the report will be printed, then separated by DEPT.
    This way, each DEPT in the plant can receive their own individual report.
    Is there anyway to do this using XMLP 5.0?
    We would be willing to upgrade our XMLP,
    if this functionality is available in a later version.
    Thanks in advance.
    Mark K

    Hi Mark
    Yep, you can do this, you can even do it in 5.0 :o)
    For some reason it did not make the user doc in 5.0 ... an Easter egg if you like.
    So I'd recommend getting the 5.5 or later docs and using that for reference. Just search for "About Oracle XML Publisher Release 5.5" on metalink once you have that doc search it for "Oracle XML Publisher User's Guide" its a link to the PDF document.
    Then check pg 86/290 - Advanced Report Layouts > Batch Reports for details. This approach will work for 5.5. If you would like a sample then if you have installed the template builder there is an Advanced > Repeating Headers folder inwhich you will find an example.
    Regards, Tim

  • How to handle goup sub total for each group in oracle query ?

    hi,
    i want to handle one complex thing in oracle query.
    i have a grouping in my oracle query.
    i want to do sub total for each group in query and after that i want to subtract one group sub total from previous group subtotal ?
    so how can i handle this in oracle query ?
    any help is greatly appreciated.
    thanks.

    Hello
    Interesting requirement.
    I wonder why are you not using these calculation during the display time. If it is acceptable then you can try using the custom formula with the running total combination in crystral report to achieve to get the required results.
    Best regards
    Ali Hadi

  • Adding ssrs chart for each group under group footer

    Hi,
    I have requirement of report design, user has ability to select single or multiple product name in parameter and it should display column headers for each group and chart for each group (product name). 
    Report Design
    ProductName: A
    Category JAN
    FEB MAR
    Sales 10
    12 15
    Budget 20
    20 20
    Chart Here
    ProductName: B
    Category JAN
    FEB MAR
    Sales 10
    12 15
    Budget 20
    20 20
    Chart Here
    I want to repeat this for all products.
    Please anyone can provide steps to how to achieve this design?

    Hi Srikanth,
    According to your description, you want to design a tablix to display header and chart for each group in its group header and footer. Right?
    In Reporting Service, when we add header and footer for a group, the header row and footer row are still within this group. Anything we put in these two rows will be grouped. For your requirement, we created a sample report in our local environment. Here
    are steps and screenshots for your reference:
    1. Create a matrix. Columns are grouped by month. Rows are grouped by ProductName (with group header and footer).
    2. Put the text/field of the first row into the group (ProductName) header. Delete the header row of matrix (the first row), select Delete rows only.
    3. Insert a chart into the group footer. It looks like below:
    4. Add a parameter for filtering data. Save and preview it looks like below:
    Reference:
    Understanding Groups (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Using If condition in For EACH Group

    Hi all,
    I want to use if condition in for-each-group. Basically my requirement is that i want to use dynamic grouping. There will be two groups and the upper group and lower group will be selected on the basis of a report parameter.
    I hope i made it clear enough. So please help me in this. Any ideas will be highly appreciable.
    Thanks and regards
    Naveed

    You can add a If condition filed after the for-each field
    for EG : <?if:ADDRESS_TYPE = 'Employee Address'?>
    and then add anothet field which has <?end if?>
    Hope this helps.
    Thanks,

  • Getting the first row for each group

    Hi Everyone,
    I have a query which returns a number of rows, all of which are valid. What I need to do is to get the first row for each group and work with those records.
    For example ...
    client flight startairport destairport stops
    A fl123 LGW BKK 2
    A fl124 LHR BKK 5
    B fl432 LGW XYZ 7
    B fl432 MAN ABC 8
    .... etc.
    I would need to return one row for Client A and one row for Client B (etc.) but find that I can't use the MIN function because it would return the MIN value for each column (i.e. mix up the rows). I also can use the rownum=1 because this would only return one row rather than one row per group (i.e. per client).
    I have been investigating and most postings seem to say that it needs a second query to look up the first row for each grouping. This is a solution which would not really be practical because my query is already quite complex and incorporating duplicate subqueries would just make the whole thing much to cumbersome.
    So what I really new is a "MIN by group" or a "TOP by group" or a "ROWNUM=1 by group" function.
    Can anyone help me with this? I'm sure that there must be a command to handle this.
    Regards and any thanks,
    Alan Searle
    Cologne, Germany

    Something like this:
    select *
    from (
       select table1.*
       row_number() over (partition by col1, col2 order by col3, col4) rn
       from table1
    where rn = 1In the "partition by" clause you place what you normally would "group by".
    In the "order by" clause you define which will have row_number = 1.
    Edit:
    PS. The [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions004.htm#i81407]docs have more examples on using analytical functions ;-)
    Edited by: Kim Berg Hansen on Sep 16, 2011 10:46 AM

Maybe you are looking for

  • Profit Center Derivation in AuC Line Item

    Hi Team, We have Investment Profile configured, where in AuC gets automatically created in background with WBS Release. Step 1: While settlement from WBS to AuC, Profit Center remains blank under Entry View for AuC Line (GL View = Inheritance from th

  • REMOVING  ADMINISTRATOR FROM iMac G4 Flat Screen

    I have a new MacBook Pro and have given my iMac G4 Flatscreen to my wife for her personal use. I was the Original Administrator on the machine and she was a user. She is now also an Administrator and I wan't to delete all reference to my account and

  • Classification - inheritance by batch of material classification

    Is there a way to have the classification settings i.e. values, for a material automatically inherited by a batch created for that material ? And if so: What are the pre-requisites ? e.g. presumably both objects must have the same classifications Whe

  • Create multiple Still Proxies

    Having a problem creating multiple still proxies. Basically what I want to do is select all the layers in a PSD imported as a cropped comp and create a half res proxy for each item. the right click "create proxy" option is disabled when I select more

  • Is HomeHub designed to be on all the time? No off ...

    Is the Home Hub designed to be on all the time, or should it be turned off when not being used for long periods eg overnight? There doesn't seem to be an on/off switch, other than turning it off and on at the plug, which seems rather brutal? On the o