AD query -- trouble with group.member list

Hello,
I'm attempting to create an AD query that filters for certain groups and all the members of those groups. I start with the groups table and filter to get the groups of interest. No problems so far.
When I expand the group column to pick up the "member" column, I get group.member and the cell values have changed from "Record" to "List."  When I expand "List" I can tell I'm at the right level of granularity,
because the number of rows has increased, and the group names are repeated for the number of members in a group. The problem is that the group.member field now shows "Record" again. I can't expand on it. And when I click on any of the "Record"
links, I can see the individual's name.
Any ideas on how I'm to get the name to show up in the full result set rather than needing to click on the "Record" link? Searching for "Power Query" with "record" has been...unhelpful (expectedly so).
Thanks

Gil,
Thanks for the reply. I notice that in my query, displayName is null for all the records returned. I have been able to get the group name information from the sAMAccountName field, although I wonder if that is what is causing the issue when I attempt to
expand. 
Here are more details on my query stages:
The first stage is with the following query (I left the "GL" filter visible since by itself it's not confidential):
let
    Source = ActiveDirectory.Domains(<domain>),
    <domain> = Source{[Domain=<domain>]}[#"Object Categories"],
    group1 = <domain>{[Category="group"]}[Objects],
    #"Expand securityPrincipal" = Table.ExpandRecordColumn(group1, "securityPrincipal", {"sAMAccountName"}, {"securityPrincipal.sAMAccountName"}),
    #"Filtered Rows" = Table.SelectRows(#"Expand securityPrincipal", each Text.StartsWith([securityPrincipal.sAMAccountName], "GL"))
in
    #"Filtered Rows"
The second stage (1st screenshot) is immediately after I expand the group column and select "member." I show the bottom view, too, which shows the three records associated with this list (the correct number of users in that AD group).
When I "expand" group.member, it changes from List to Record and there is now one row for each user in a group. However, when I go to pick the displayName column from group.member, it gives me the message "No columns were found." Yet,
when I select the group.member value, I can see in the view below that there is a displayName. (See 2nd screenshot.) Note that I filtered the records in the third screenshot to just a single group -- 3 records.
Does this additional information help isolate what I might be experiencing?
Here is the query to match the final screenshot:
let
    Source = ActiveDirectory.Domains(<domain>),
    <domain> = Source{[Domain=<domain>]}[#"Object Categories"],
    group1 = <domain>{[Category="group"]}[Objects],
    #"Expand securityPrincipal" = Table.ExpandRecordColumn(group1, "securityPrincipal", {"sAMAccountName"}, {"securityPrincipal.sAMAccountName"}),
    #"Filtered Rows" = Table.SelectRows(#"Expand securityPrincipal", each Text.StartsWith([securityPrincipal.sAMAccountName], "GL")),
    #"Expand group" = Table.ExpandRecordColumn(#"Filtered Rows", "group", {"member"}, {"group.member"}),
    #"Expand group.member" = Table.ExpandListColumn(#"Expand group", "group.member"),
    #"Expand top" = Table.ExpandRecordColumn(#"Expand group.member", "top", {"name"}, {"top.name"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expand top",{"msExchIMRecipient", "ciscoEcsbuUMAttributes", "posixGroup", "top.name", "msExchBaseClass",
"msExchCustomAttributes", "mailRecipient"})
in
    #"Removed Columns"
Scott C.

Similar Messages

  • Target Group Member List Display and Output to Excel

    Hi all,
    I am using CRM 2007.  On the Web Client I want to output to excel a target group with 7000 accounts. I have 2 users. One User when the target group is selected can see all the details of all 7000  in the target group members list and when exported to excel all 7000 accounts are listed in the excel file.
    With the second user when the target group is selected only the details of 100 accounts are visible in the target group members list and when exported to excel only 100 of the accounts are output.
    The 2 users have the same roles and parameters and the personalize icon next to the excel export button also have the same settings.
    Does anyone know where the setting is that will allow the second user to output all 7000 on the list?
    Help would be greatly appreciated.
    Thanks,
    Jonathan

    Hi Jonathan,
    Open a Profile Set with user2.
    Push button "Graphical Modeler".
    When the modeler is loaded , Press button "Settings".
    On the upcoming popup, you can change the number of members that are loaded to the Target Group Member list in the WebUI in the field "Number of Members Displayed".
    Most probably, this field is empty for your second user, so the default of 100 is used.
    Note that a maximum of 9999 members can be loaded to the list in the UI. For bigger Target Groups, you must export the list to the application server using the "Export to File" button on the Target Group WebUI page.
    Hope that helps & Best Regards
    Klaus

  • Extension of target group member list

    Hi,
    does anybody know a guide or something else in which way i have to define additional fields for displaying target group member list?
    Thanks in advance
    Tobias

    solved by myself!

  • Trouble with Integrating The Lists Service

    I have managed to integrate the lists service but, I can't save anything I do and anytime I do anything with the lists service I get this message. An error occurred accessing the WebCenter repository.
    When I start up the app I get:
    Error code 942: table or view does not exist
    Call: SELECT * FROM (SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum  FROM (SELECT ACTIVITY_ACTOR_DETAIL_ID AS a1, STATUS AS a2, DEPARTMENT AS a3, APPLICATION_ID AS a4, ENTERPRISE_ID AS a5, VERSION AS a6, EMAIL AS a7, ACTOR_ID AS a8, MANAGER_ID AS a9, DISPLAY_NAME AS a10, UPDATED_ON AS a11, ACTOR_NAME AS a12, JOB_TITLE AS a13 FROM WC_AS_ACTOR_DETAIL WHERE (ACTOR_ID = ?)) a WHERE ROWNUM <= ?) WHERE rnum > ?
         bind => [C67208F0F21611E18F6D0FE5FA5B26A4, 1, 0]
    Query: ReadAllQuery(name="WcAsActorDetail.findActorByActorId" referenceClass=WcAsActorDetail sql="SELECT * FROM (SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum  FROM (SELECT ACTIVITY_ACTOR_DETAIL_ID AS a1, STATUS AS a2, DEPARTMENT AS a3, APPLICATION_ID AS a4, ENTERPRISE_ID AS a5, VERSION AS a6, EMAIL AS a7, ACTOR_ID AS a8, MANAGER_ID AS a9, DISPLAY_NAME AS a10, UPDATED_ON AS a11, ACTOR_NAME AS a12, JOB_TITLE AS a13 FROM WC_AS_ACTOR_DETAIL WHERE (ACTOR_ID = ?)) a WHERE ROWNUM <= ?) WHERE rnum > ?")But when I run this query
    Select * from all_objects
    where object_type in ('TABLE', 'VIEW')
    AND object_name = 'WC_AS_ACTOR_DETAIL';It finds the table
    OWNER                          OBJECT_NAME                    SUBOBJECT_NAME                 OBJECT_ID              DATA_OBJECT_ID         OBJECT_TYPE         CREATED                   LAST_DDL_TIME             TIMESTAMP           STATUS  TEMPORARY GENERATED SECONDARY NAMESPACE              EDITION_NAME                  
    DEV1_WEBCENTER                 WC_AS_ACTOR_DETAIL                                            75853                  75853                  TABLE               17-SEP-12                 17-SEP-12                 2012-09-17:11:36:23 VALID   N         N         N         1                                                    
                                                      What am I doing wrong? Did I forget to do something or did I not do something right?
    Edited by: beachw08 on Sep 18, 2012 6:32 AM
    Edited by: beachw08 on Sep 18, 2012 8:18 AM
    Edited by: beachw08 on Sep 18, 2012 8:52 AM

    Yes I did that. I have a connection to the database and I have the WebCenter schema installed on my database. I don't understand why it can't find the table, I can find the table. Also do I have to use spaces or can Framework use lists?
    Edited by: beachw08 on Sep 19, 2012 8:35 AM
    Edited by: beachw08 on Sep 19, 2012 8:46 AM

  • Trouble with Group By in RTF Template

    Hello All,
    I'm very new at RTF Template building, and I've spent hours trying to figure this out with no avail. I'm using BIP Desktop add-in for Word to load in my XML data and create some tables and charts. Right now I'm able to create a detail level table on the RTF, but I want to also create a summary level table. The summary table is where I get stuck, as I can't get my group by statements to work. I've tried to insert a table/form and use the table wizard, but neither work.
    My detail level table has customer and shipments (among a few other noncritical fields). I just want a summary table to show customer and total number of shipments (simple count function). Right now, my output looks something like this:
    Customer     Customer
    Brian Jones     Shipment 
         1
         1
         1
         1
         1
         1
         1
         1
         1
    So it groups by the customer fine, but doesn't actually count the shipments. It assigns a 1 for each shipment number, but doesn't actually count the fields to give a Brian - 9.
    Again, I'm very new at this, so this might be very basic. Also, if there are any good resources on RTF template building, I'd love some help on learning to do this stuff better.
    Thanks!
    Alex

    Don't you want to actually find the sum of the shipments to give you a count of shipments for the customer? Have you tried using the sum function for your shipments field?
    You could insert the shipment field, select function sum (from the drop-down menu) and check the 'On grouping' box..
    Send me your template and sample XML to [email protected] if you would like.

  • Query trouble with DI Server

    Hello everybody,
    I'm trying to execute SQL with DI Server. This is my SOAP-command:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header>
        <SessionID>63089993-AC37-4225-845D-D9722A50D5A7</SessionID>
      </env:Header>
      <env:Body>
        <dis:ExecuteSQL xmlns:dis="http://www.sap.com/SBO/DIS">
          <DoQuery>SELECT NULL AS Cat1Name, NULL AS Cat2Name, NULL AS Cat3Name, NULL AS Cat4Name,
              NULL AS Cat1Code, NULL AS Cat2Code, NULL AS Cat3Code, NULL AS Cat4Code
              FROM OITM
              WHERE 0 = 1 /* Dummy query to circumvent problems with XML-tag */
              UNION
              SELECT Cat1Name, Cat2Name, Cat3Name, Cat4Name, Cat1Code, Cat2Code, Cat3Code, Cat4Code
              FROM (
                SELECT cat1.Name AS Cat1Name, cat2.Name AS Cat2Name, cat3.Name AS Cat3Name, cat4.Name AS Cat4Name,
                cat1.Code AS Cat1Code, cat2.Code AS Cat2Code, cat3.Code AS Cat3Code, cat4.Code AS Cat4Code
                FROM @CATEGORY_4 cat4
                JOIN @CATEGORY_3 cat3 ON cat3.Code = cat4.U_Category_3
                JOIN @CATEGORY_2 cat2 ON cat2.Code = cat3.U_Category_2
                JOIN @CATEGORY_1 cat1 ON cat1.Code = cat2.U_Category_1
              UNION
                SELECT cat1.Name AS Cat1Name, cat2.Name AS Cat2Name, cat3.Name AS Cat3Name, NULL AS Cat4Name,
                  cat1.Code AS Cat1Code, cat2.Code AS Cat2Code, cat3.Code AS Cat3Code, NULL AS Cat4Code
                FROM @CATEGORY_3 cat3
                JOIN @CATEGORY_2 cat2 ON cat2.Code = cat3.U_Category_2
                JOIN @CATEGORY_1 cat1 ON cat1.Code = cat2.U_Category_1
              UNION
                SELECT cat1.Name AS Cat1Name, cat2.Name AS Cat2Name, NULL AS Cat3Name, NULL AS Cat4Name,
                  cat1.Code AS Cat1Code, cat2.Code AS Cat2Code, NULL AS Cat3Code, NULL AS Cat4Code
                FROM @CATEGORY_2 cat2 JOIN @CATEGORY_1 cat1 ON cat1.Code = cat2.U_Category_1
              UNION
                SELECT cat1.Name AS Cat1Name, NULL AS Cat2Name, NULL AS Cat3Name, NULL AS Cat4Name,
                  cat1.Code AS Cat1Code, NULL AS Cat2Code, NULL AS Cat3Code, NULL AS Cat4Code
                FROM @CATEGORY_1 cat1
              ) TMP
              WHERE ISNULL(Cat1Code, '') = '101'
              OR ISNULL(Cat2Code, '') = '101'
              OR ISNULL(Cat3Code, '') = '101'
              OR ISNULL(Cat4Code, '') = '101'
              OR '101' = ''</DoQuery>
        </dis:ExecuteSQL>
      </env:Body>
    </env:Envelope>
    When I run the SQL-bit in SQL Server 2005, all is fine. When I run this with DI Server, I get this response:
    <?xml version="1.0"?>
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
      <env:Body>
        <env:Fault>
          <env:Code>
            <env:Value>env:Receiver</env:Value>
            <env:Subcode>
              <env:Value>229</env:Value>
            </env:Subcode>
          </env:Code>
          <env:Reason>
            <env:Text xml:lang="en">Failed to execute command</env:Text>
          </env:Reason>
          <env:Detail>
            <Statement>..The Query..</Statement>
            <Command>ExecuteSQL</Command>
            <SessionID>63089993-AC37-4225-845D-D9722A50D5A7</SessionID>
          </env:Detail>
        </env:Fault>
      </env:Body>
    </env:Envelope>
    Is this query too complex for the DI server to handle? Is it the subquery? Is it the unions?
    Thanks for your time!
    Vincent

    I have tried other queries in my application and they all don't seem to work anymore.
    I recently upgraded from PL39 to PL42. Has there been a change in the SOAP schema again?

  • Enable group mailing list in Server.app not working

    Hello everyone,
    I have been trying to enable a new (?) feature of Server.app : "Enable group mailing list". Until now, it does not work for me. When I try to send an email to the group [email protected], Mail tells me that the smtp server cannot send my message. Here is what I see on the server's /var/log/mail.log file :
    Sep 10 16:55:54 testserver01.pretendco.net postfix/smtpd[2311]: NOQUEUE: reject: RCPT from testclient01.pretendco.net[10.1.101.10]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<testclient01.pretendco.net>
    Sep 10 16:55:54 testserver01.pretendco.net postfix/smtpd[2311]: disconnect from testclient01.pretendco.net[10.1.101.10]
    It is interesting to note that group mailing list aren't even mentioned in the Mac OS X Server Advanced Administration Guide :
    http://help.apple.com/advancedserveradmin/mac/10.8/#apd9430d30c-5796-4a20-a8f9-1 20638938942
    Does any has any good/bad experience with group mailing lists under Mountain Lion Server ? Any advice ?
    Thanks a lot !

    Hello Mark23 and thanks for your help !
    The log says nothing particular when I (un)set the "Enable Group Mailing List Option". The only difference I see is a line saying mail_groups[127]: sleeping for: 1 hour(s). I have no idea what this means exactly. Googling it did not help me much either.
    I post the /etc/aliases file below. Interesting : every time I (un)set the "Enable Group Mailing List" option, the /etc/aliases last access time changes. But the md5 hash of the file stays the same.
    I guess that the "sudo newaliases" uses /etc/aliases to construct the binary database file /etc/aliases.db ? It seems that this script is run every time I (un)check the option since the access time of *both* /etc/aliases and /etc/aliases.db are changed to the current time.
    Do you have any other option checked ?
    Here is my /etc/aliases (I removed the blocks of comments at the beginning and at the end):
    # Person who should get root's mail. Don't receive mail as root!
    #root:                    you
    # Basic system aliases -- these MUST be present
    MAILER-DAEMON:          postmaster
    postmaster:          root
    # General redirections for pseudo accounts
    bin:                    root
    daemon:                    root
    named:                    root
    nobody:                    root
    uucp:                    root
    www:                    root
    ftp-bugs:          root
    postfix:          root
    # Put your local aliases here.
    # ==== Begin auto-generated section ========================================
    # This section of the aliases file is auto-generated by server admin tools
    # Please do not edit this section or your modifications will be lost
    # === End auto-generated section ===========================================
    # Well-known aliases
    manager:          root
    dumper:                    root
    operator:          root
    abuse:                    postmaster
    # trap decode to catch security attacks
    decode:                    root

  • Problem with Grouping Query

    I am having trouble with a query.
    Table 1
    id     status
    1      STARTED
    2      STARTED
    3      STARTED
    4      STARTED
    5      STARTED
    6      INCOMPLETE
    7      INPROGRESS
    Table 2
    id     individual
    1      MMJ
    1      JBJ
    2      MKJ
    3     MKJ
    3      LJJ
    4      MMJ
    5      MMJ
    5      JBJ
    6      ADJ
    7      ADJ
    The two tables are linked by id.
    The user wants to see the count of STARTED projects for two groups.
    Group 1 is MMJ, JBJ, ADJ
    Group 2 is MKJ, LJJ
    These groups aren’t assigned anywhere in the schema – I just got a list of names and what group they should go into…
    How do I go about grouping the individuals and then how do I perform the count?
    I did do a count and group by individual but my results are skewed because I get a double count on the ids that have multiple individuals assigned. Can anyone provide some insight?
    Thank You!

    SELECT
       SUM(group1),
       SUM(group2)
    FROM
        SELECT DISTINCT
           t1.id,
           DECODE(t2.individual, 'MMJ', 1, 'JBJ', 1, 'ADJ', 1, 0) group1,
           DECODE(t2.individual, 'MKJ', 1, 'LJJ', 1, 0) group2
        FROM
           (select 1 id, 'STARTED' status from DUAL
            union
            select 2 id, 'STARTED' status from DUAL
            union
            select 3 id, 'STARTED' status from DUAL
            union
            select 4 id, 'STARTED' status from DUAL
            union
            select 5 id, 'STARTED' status from DUAL
            union
            select 6 id, 'INCOMPLETE' status from DUAL
            union
            select 7 id, 'INPROGRESS' status from DUAL
           ) t1,
           (select 1 id, 'MMJ' individual from dual
            union
            select 1 id, 'JBJ' individual from dual
            union
            select 2 id, 'MKJ' individual from dual
            union
            select 3 id, 'MKJ' individual from dual
            union
            select 3 id, 'LJJ' individual from dual
            union
            select 4 id, 'MMJ' individual from dual
            union
            select 5 id, 'MMJ' individual from dual
            union
            select 5 id, 'JBJ' individual from dual
            union
            select 6 id, 'ADJ' individual from dual
            union
            select 7 id, 'ADJ' individual from dual
           ) t2
        WHERE
           t1.id = t2.id AND
           t1.status = 'STARTED'
    SUM(GROUP1) SUM(GROUP2)
              3           2

  • Incorrect warning when parsing query with group by clause

    I am using SQL Developer 4.0.0.13.80 with JDK 1.7.0_51 x64 on Windows 8.1
    I have the following SQL, which works perfectly:
    select substr(to_char(tot_amount), 0, 1) as digit, count(*)
    from transactions
    where tot_amount <> 0
    group by substr(to_char(tot_amount), 0, 1)
    order by digit;
    However, SQL Developer is yellow-underlining the first line, telling me that:
    SELECT list is inconsistent with GROUP BY; amend GROUP BY clause to: substr(to_char(rep_tot_amount), 0, 1), substr(to_char(rep_tot_amount),
    which is clearly wrong.
    Message was edited by: JamHan
    Added code formatting.

    Hello,
    I also have found the same issue with the GROUP BY hint. Another problem I found is that the hint suggests to amend the GROUP BY members to add also constant values that are included in the SELECTed columns and whenever those constants include strings with spaces, it generates an invalid query. Normally, constant values won't affect grouping functions and as such they can be omitted from the GROUP BY members, but it seems SQL Dev thinks it differently.
    For example, if you try the following query:
    SELECT d.DNAME, sum(e.sal) amt, 'Total salary' report_title, 100 report_nr
    FROM scott.emp e, scott.dept d
    WHERE e.DEPTNO = d.DEPTNO
    GROUP BY d.DNAME;
    when you hover the mouse pointer on the yellow hint, a popup will show the following message:
    SELECT list inconsistent with GROUP BY; amend GROUP BY clause to:
    d.DNAME, 'Total, 100
    If you click on the hint, it will amend the group by members to become:
    GROUP BY d.DNAME, 'Total, 100;
    that is clearly incorrect syntax. You may notice that after the change the yellow hint is still there, suggesting to amend further the GROUP BY members. If you click again on the hint, you will end with the following:
    GROUP BY d.DNAME, 'Total, 100;
    , 'Total, 100
    and so on.
    I am not sure if this behaviour was already known (Vadim??), but it would be nice if somebody could file a bug against it.
    Finally when writing big queries with complex functions and constant columns, those yellow lines extend all over the select list and they are visually annoying, so I wonder if there is a way to disable the GROUP BY hint until it gets fixed.
    Thanks for any suggestion,
    Paolo

  • Having trouble with query

    I am trying to query for a report to list aircraft by manufacturer, model name, aircraft number, destinations flown, miler per charter and the total revenue per charter, as well as total amount of revenue generated and total number of mile flown for each aircraft. This is what I have so far, I keep getting stumped when I try to sum I get error that certain lines is not single-group group function.
    -----DATA
    3 tables:
    Aircraft {PK} ac_number
    {FK} mod_code
    ac_ttaf
    ac_ttel
    ac_tter
    Model {PK} mod_code
    mod_manufacturer
    mod_name
    mod_seats
    mod_chg_mile
    Charter {PK} char_trip
    char_date
    {FK2} ac_number
    char_destination
    char_hours_flown
    char_hours_wait
    char_fuel_gallons
    char_oil_qts
    FK1} cus_code
    ---code written so far--
    --program Unit 5 Q4 Reprot of Aircraft By Renvue                         
    --author Barbara Forget                                                  
    --date February 24.2008                                                  
    --purpose to list aircraft by revenue, model, manufacturer and number    
    SELECT m.mod_manufacturer "MANUFACTURER",
    m.mod_name "A/C NAME",
    a.ac_number "A/C #",
    c.destination "AIRPORT",
    c.char_distance "TOTALMILEAGE"
    FROM hartmar.model m,
    hartmar.aircraft a,
    hartmar.charter c
    WHERE m.mod_code = a.mod_code (+)
    AND a.ac_number = c.ac_number (+)
    ORDER BY m.mod_name
    Can someone give me a little input as to how to accomplish this, I get the report as such
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Axtec 1484P BNA 352
    Piper Axtec 1484P STL 508
    Piper Axtec 1484P TYS 644
    Piper Axtec 1484P STL 472
    Piper Axtec 1484P STL 508
    Piper Axtec 1484P TYS 644
    Piper Axtec 1484P BNA 352
    Piper Axtec 1484P STL 472
    Piper Axtec 1484P STL 508
    Cessna Citation Mustang 1234C
    Cessna Citation Sovereign 2345C
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Beechcraft KingAir 2289L GNV 1645
    Beechcraft KingAir 2289L ATL 1023
    Beechcraft KingAir 2289L GNV 1645
    Beechcraft KingAir 2289L GNV 1574
    Beechcraft KingAir 2289L ATL 936
    Beechcraft KingAir 2289L ATL 936
    Beechcraft KingAir 2289L GNV 1574
    Beechcraft KingAir 2289L ATL 1023
    Beechcraft KingAir 2289L GNV 1574
    Beechcraft KingAir 2289L GNV 1574
    Piper Navajo Chieftain 2278V GNV 1574
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Navajo Chieftain 4278Y TYS 644
    Piper Navajo Chieftain 2278V BNA 320
    Piper Navajo Chieftain 4278Y GNV 1574
    Piper Navajo Chieftain 4278Y GNV 1574
    Piper Navajo Chieftain 4278Y STL 472
    Piper Navajo Chieftain 2278V GNV 1574
    Piper Navajo Chieftain 2278V BNA 320
    Piper Navajo Chieftain 4278Y ATL 998
    Piper Navajo Chieftain 4278Y TYS 644
    Piper Navajo Chieftain 2278V MOB 884
    Piper Navajo Chieftain 4278Y TYS 646
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Navajo Chieftain 4278Y ATL 936
    Piper Navajo Chieftain 2278V MQY 312
    Piper Navajo Chieftain 2278V MQY 312
    Piper Navajo Chieftain 4278Y ATL 936
    Piper Navajo Chieftain 4278Y TYS 646
    Piper Navajo Chieftain 2278V MOB 884
    Piper Navajo Chieftain 4278Y ATL 998
    Piper Navajo Chieftain 4278Y STL 472
    Piper Navajo Chieftain 4278Y ATL 998
    Piper Navajo Chieftain 4278Y GNV 1574
    Piper Navajo Chieftain 2278V BNA 320
    MANUFACTURER A/C NAME A/C # AIR TOTALMILEAGE
    Piper Navajo Chieftain 4278Y TYS 644
    Piper Navajo Chieftain 4278Y ATL 936
    Piper Navajo Chieftain 4278Y TYS 646
    47 rows selected.
    but, I need each a/c to be listed once with charter number total miles flown and total revenue generated.
    Any suggestions?

    Here's what I could fathom:
    test@ORA10G>
    test@ORA10G> with model as (
      2    select 1 as mod_code, 'Cessna' as mod_manufacturer, 'Citation Mustang' as mod_name, 0.1 as mod_chg_mile from dual union all
      3    select 2,'Piper',     'Axtec',             0.2 from dual union all
      4    select 3,'Piper',     'Navajo Chieftain',  0.3 from dual union all
      5    select 4,'Beechcraft','KingAir',           0.1 from dual union all
      6    select 5,'Cessna',    'Citation Sovereign',0.5 from dual),
      7  aircraft as (
      8    select '1234C' as ac_number, 1 as mod_code from dual union all
      9    select '1484P', 2 from dual union all
    10    select '2278V', 3 from dual union all
    11    select '2289L', 4 from dual union all
    12    select '2345C', 5 from dual union all
    13    select '4278Y', 3 from dual),
    14  charter as (
    15    select 1 as char_trip, '1234C' as ac_number, null as destination, null as char_distance from dual union all
    16    select 2, '1484P', 'BNA', 10     from dual union all
    17    select 3, '1484P', 'STL', 10     from dual union all
    18    select 4, '1484P', 'STL', 20     from dual union all
    19    select 5, '1484P', 'TYS', 100    from dual union all
    20    select 6, '2278V', 'BNA', 20     from dual union all
    21    select 7, '2278V', 'GNV', 30     from dual union all
    22    select 8, '2278V', 'MOB', 40     from dual union all
    23    select 9, '2278V', 'MQY', 50     from dual union all
    24    select 10, '2289L', 'ATL', 10    from dual union all
    25    select 11, '2289L', 'ATL', 20    from dual union all
    26    select 12, '2289L', 'GNV', 15    from dual union all
    27    select 13, '2289L', 'GNV', 25    from dual union all
    28    select 14, '2345C',  null, null  from dual union all
    29 select 15, '4278Y', 'ATL', 10 from dual union all
    30 select 16, '4278Y', 'ATL', 25 from dual union all
    31    select 17, '4278Y', 'GNV', 35    from dual union all
    32    select 18, '4278Y', 'STL', 20    from dual union all
    33    select 19, '4278Y', 'TYS', 40    from dual union all
    34    select 20, '4278Y', 'TYS', 50    from dual)
    35  --
    36  SELECT
    37    m.mod_manufacturer as manufacturer,
    38    m.mod_name as ac_name,
    39    a.ac_number as ac_num,
    40    c.destination as airport,
    41    sum(c.char_distance) as total_mileage,
    42    to_char(sum(c.char_distance*m.mod_chg_mile*0.035),'$99,990.99') as trip_charge
    43  FROM
    44    model m,
    45    aircraft a,
    46    charter c
    47  WHERE m.mod_code = a.mod_code(+)
    48  AND a.ac_number = c.ac_number(+)
    49  GROUP BY m.mod_manufacturer,
    50           m.mod_name,
    51           a.ac_number,
    52           c.destination;
    MANUFACTUR AC_NAME            AC_NU AIR TOTAL_MILEAGE TRIP_CHARGE
    Piper      Axtec              1484P BNA            10       $0.07
    Piper      Navajo Chieftain   2278V BNA            20       $0.21
    Piper      Navajo Chieftain   2278V MQY            50       $0.53
    Piper      Navajo Chieftain   4278Y TYS            90       $0.95
    Piper      Navajo Chieftain   4278Y GNV            35       $0.37
    Cessna     Citation Mustang   1234C
    Piper      Navajo Chieftain   2278V MOB            40       $0.42
    Piper      Axtec              1484P STL            30       $0.21
    Piper      Axtec              1484P TYS           100       $0.70
    Piper      Navajo Chieftain   4278Y STL            20       $0.21
    Piper      Navajo Chieftain   2278V GNV            30       $0.32
    Beechcraft KingAir            2289L ATL            30       $0.11
    Cessna     Citation Sovereign 2345C
    Beechcraft KingAir            2289L GNV            40       $0.14
    Piper Navajo Chieftain 4278Y ATL 35 $0.37
    15 rows selected.
    test@ORA10G>
    test@ORA10G>Notes:
    (1) Lines 29 and 30 (in bold) show that '4278Y', which corresponds to mod_code = 3 i.e. "Piper Navajo Chieftain", flew to ATL twice traveling 10 and 20 miles respectively.
    (2) The last line of the resultset (in bold) shows the total miles for "Piper Navajo Chieftain" i.e. 35 miles.
    The trip charge, consequently, is 35 miles * 0.3 * 0.035 = 0.3675
    where 0.3 is the mod_chg_mile for "Piper Navajo Chieftain".
    (3) Note the change in the columns that constitute the GROUP BY clause. What it does is - for every combination of:
        (i)    m.mod_manufacturer
        (ii)   m.mod_name
        (iii)  a.ac_number
        (iv)   c.destinationit sums up the c.char_distance and multiplies it with the product of m.mod_chg_mile and 0.035.
    (4) Also note that you can use aggregate functions (sum, in this case) more than once in the SELECT <column_list> part of the query. You need to include the rest of the columns (the 4 above) in the GROUP BY clause.
    Hope that helps.
    cheers,
    pratz

  • Trouble with city, state in Mysql Query

    Hello,
    I am having trouble with a query I am trying to setup.  Basically, I want the user to type in their city.  Then I want the system to ask them which city,state combo is theirs.  So if they enter "Washington" the system will return:
    Select your city/state:
    Washington, NJ
    Washington, PA
    Washington, DE
    City and state are stored as two fields in my mysql DB.  I was considering using 'select distinct' but I wasnt sure how it would work in relation to two fields.  So how would I go about making sure washington, nj only appears once (its in a database where there will be multiple washington, NJ listed).
    So anyone have any ideas or code samples they have used to do something like this?
    Thanks in advance,
    Mark

    davella wrote:
    City and state are stored as two fields in my mysql DB.  I was considering using 'select distinct' but I wasnt sure how it would work in relation to two fields.  So how would I go about making sure washington, nj only appears once (its in a database where there will be multiple washington, NJ listed).
    DISTINCT works the same way for single field or multiple fields.  It returns all distinct combinations of the values in the columns you have listed.
    SELECT  DISTINCT City, State
    FROM     Table
    WHERE  City = 'Washington'
    (Data) City, State
    Washington, NJ
    Washington, PA
    Washington, NJ
    Washington, DE
    Washington, NJ
    Washington, PA
    So for your two columns it would distinct combinations of the "City" and "State" values.  But why are there multiple "Washington, NJ" records? Are they actually different cities or duplicate records?
    (Results)
    Washington, NJ
    Washington, PA
    Washington, DE

  • Trouble with query on Reports

    Hi,
    I am having trouble with a query which results from a join of 4 tables, of which, one table is shortened by grouping it along one column.
    for example
    A join B join C join (D grouped by D.S)
    In MS Access I had used a separate query to represent this and done a join with the remaining tables to generate my report.
    Any one has any idea about how this can be done using just one query, or any way I can store the sub-result elsewhere like in Access.
    Thanks!

    Not usre this is a reports issue, but:
    I think you are trying to select from tables and queries in one.
    IN your SQL statement try
    SELECT data,etc
    FROM
    A,
    B,
    C
    , (select distinct S from D) Q_D
    where
    A join B join C join Q_D
    Note that I don't think you can use sub queries like this in Access

  • Modify with custom query in contracts to do list workbench channel is not working

    Hi Experts,
    We have a requirement to change the standard query with custom query under 'Contract To Do List' workbench channel. This requirement is for 'Master Agreements'  and Master Agreements Requiring Attention entries in the channel. I have replaced the standard query with my custom query in Setup --> Query groups select the query group To-Do List Queries (FCI-ToDoListBuyReport) and replace the To-Do Master Agreements query definition with my custom query. Same thing I did for second query also.
    But it is not reflecting in Contract To Do List work bench channel. Please see below screen shot.
    However if I revert to standard query 'Master Agreements'  link is displaying.
    Did any one had this kind of requirement and how did you achieve this if you share some thoughts on this it will really appreciated.
    Regards,
    Lava.

    Hi All,
    Issue resolved.
    Raised OSS for this and SAP suggested that include 'ToDo-CON' word in custom query internal name.
    Regards,
    Lava

  • When I send a Group message from my address book, the entire group gets listed in the "To" line. How do I get each member to receive the message individually without listing all members? Its just messy is all.

    When I send a Group message from my address book, the entire group gets listed in the "To" line. How do I get each member to receive the message individually without listing all members? Its just messy is all. Any help is greatly appreciated.

    Hey Grupo Castillo,
    Thanks for the question. You can actually configure this behavior from Mail preferences:
    1. Choose Preferences from the Mail menu.
    2. Click Composing.
    3. Deselect the checkbox for "When sending to a group, show all member addresses".
    When you send an email to the group, only the groups name will be seen.
    Mac OS X: Mail - How to Hide Address Book Group Member Names When Sending an Email
    http://support.apple.com/kb/TA21082
    Thanks,
    Matt M.

  • I dont receive e-mails with attachment sent to OS X Server 3.0.1 Group-mailing lists

    I have a small company using a mac mini with mavericks and server 3.0.1.
    We are using most of the services available in OS X server (except DHCP, Netinstall and Xsan). One of the services we use the most is Mail server, and the whole company uses that as our primary mail server.
    We have set up several different Groups and activated group-mailing lists on some of them. The setup has been working very good for over a year (started using it with Mountain Lion Server).
    Recently I was going to send a christmas card to all employees using the workgroup mailing list. I was using the stationaries in Mail, and it was sent as normal but never recieved by me or any of the other employees. Below is the SMTP Log
    Dec  6 17:10:16 server.mydomain.com postfix/smtpd[29101]: connect from unknown[10.0.1.16 *<- my local IP address*]
    Dec  6 17:10:16 server.mydomain.com postfix/smtpd[29101]: 480451503B0A: client=unknown[10.0.1.16 *<- my local IP address*], sasl_method=CRAM-MD5, sasl_username=myusername
    Dec  6 17:10:16 server.mydomain.com postfix/cleanup[29109]: 480451503B0A: message-id=<[email protected]>
    Dec  6 17:10:16 server.mydomain.com postfix/qmgr[23288]: 480451503B0A: from=<[email protected]>, size=98063, nrcpt=1 (queue active)
    Dec  6 17:10:16 server.mydomain.com postfix/local[29110]: 480451503B0A: to=<[email protected]>, relay=local, delay=0.13, delays=0.05/0.01/0/0.08, dsn=2.0.0, status=sent (delivered to command: /Applications/Server.app/Contents/ServerRoot/usr/libexec/MailService/list_serve r_post post workgroup)
    Dec  6 17:10:16 server.mydomain.com postfix/qmgr[23288]: 480451503B0A: removed
    Dec  6 17:11:16 server.mydomain.com postfix/smtpd[29101]: disconnect from unknown[10.0.1.16 *<- my local IP address*]
    I did some trial and error and it seems like it is linked to the fact that I have attachments to the email. Sending an email with only text is recieved like normal. Even attacment like PDF or jpg is "blocked" it seems. I have tried using email outside my domain but still the same result. Sending the same email (with attachment) to all reciepients (not using the mailiing list) works and is recieved by everyone. I have turned off all email filtering settings on the server but still the same result.
    Is anyone else experiencing the same problem? My guess is that this is a Server 3.0.1 hickup, so it would be nice to get confirmation from others experiencing the same.

    Troubleshooting Apple Mail
    What does Mail/Window/Connection Doctor Show? If the server is red, select it and look at the Show Details box.
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages

Maybe you are looking for

  • Multiple select-options in a screen But no screen space

    Dear Experts, I have mutiple select options in a screen, i am finding it a problem to display them all in one screen. it should be done with out any vertical scroll nor horizontol scroll. Awaiting to hear from you all. Regards, Karthik

  • Flex and SAP integration

    Hello All,   I am in a requirement in which i need to connect to SAP server and fetch data from it and display back in Flex builder. I am a bit familiar with Flash Island intro but not much. So my question is what are the possible way we can fetch da

  • How to change the Settings in the Graphic structure. T Code CN41

    Hi, How to change the Settings in the Graphic structure. T Code CN41 Iam using the T Code cn41 to know the diff in Duruation, work, remaining duration in diff project version. I am getting the Graph/curve with standard settings and system is not allo

  • How to View Output From Customized Form

    I have developed a new customized form and attach it in Receipt Form Menu. I have added a button of Print Receipt on the form by name Print Screen.I have added code behind the Print Receipt Button that when it would be clicked report of receipt would

  • History not sorting correctly

    When I go to my history, and I try to go back to, say, November, it still starts with today, which means I have to go through a lot of pages to get to what I'm looking for.