SORT ORDER WITHIN GROUPS

Post Author: Kara
CA Forum: General
Hi,
I am using version 9. I have designed a report based on an access control database. It shows a person's time in and time out, then totals these hours. My report is grouped as follows:
Department
Date/Time
Unique ID
The main data of the report is shown in group footer 3 (Unique ID) and is displayed in numerical order. I need to change the sort order to display by last name, first name but because I have grouped by unique ID I can't seem to be able to do it!
Any help gratefully received,
Kara

Post Author: CoolTowers
CA Forum: General
I use a similar report to track service personnel who also have a unique ID.  I have mine set up as follows - maybe this'll help.
I used selection expert to specify the dates I want to see. 
Group 1 sorts on the unique ID. Instead of printing the unique ID field in the group header, I have Employee.EmpName.  They'll come out in their unique ID sort so the names might be a little out of order. If that's a problem you could put sort option on that field.
Group 2 sorts by the Job ID, with the group header suppressed.
Detail line has location, job id, date, time on, time off, total time in hours and if it's completed.
Group 2 summarizes at date and amount at the job ID level.
Group 1 summarizes at technician.
I get very accurate reports to match against their hand written time cards.
Perhaps if you re-arranged the grouping?

Similar Messages

  • Sort order for group by functions

    I have table TAB1(notenum number, linenum number, linetext varchar2(100)).
    Each note can have multiple lines of text. Eg data
    NOTENUM     LINENUM     LINETEXT
    1     1     THIS IS LINE1.
    1     2     THIS IS LINE2.
    2     1     THIS IS LINE1 OF NOTE2.
    2     2     THIS IS LINE2 OF NOTE2.
    I need the text of lines of the most recent note (max notenum)
    <Note>THIS IS LINE1 OF NOTE2. THIS IS LINE2 OF NOTE2</Note>.
    I have a query like this
    SELECT XMLAGG(XMLPARSE(CONTENT LINETEXT WELLFORMED))
    FROM TAB1
    GROUP BY NOTENUM
    ORDER BY NOTENUM DESC
    Above query would return the text of all lines concatenated for each note and the first row would be the one with highest notenum value.
    My problem is that concatenation of the LINETEXT should happen in ascending order of LINENUM. Since LINENUM is not in GROUP BY clause I cannot specify it in ORDER BY.
    How can I specify to XMLAGG (for that matter any group by function) to concatenate text in a specific order.
    I hope I was able to explain my problem clear enough for somebody to help.
    thanks for all the help
    Message was edited by:
    user448703
    Message was edited by:
    user448703

    Never mind. I just found out that XMLAGG function has the option to specify ORDER BY. I think that will work.

  • Order within in Groups - Urgent please

    Hi,
    Please let me know how can I achieve the following output.
    I have following four tables,
    COUNTRY_MASTER table contains SL_NO, COUNTRY_CODE, COUNTRY_NAME, .... columns.
    STATE_MASTER table contains SL_NO, STATE_CODE, STATE_NAME, ... columns.
    COUNTY_MASTER table contains SL_NO, COUNTY_CODE, COUNTY_NAME, ... columns.
    CITY_MASTER table contains SL_NO, CITY_CODE, CITY_NAME, ... columns.
    I have another mapping table,
    MAPPING_TABLE table contains SL_NO, COUNTRY_SL_NO, STATE_SL_NO, COUNTY_SL_NO, CITY_SL_NO, ... columns.
    I want output like this -
    first column is LEVEL which contains 1 for Country, 2 for State, 3 for Country and 4 for City.
    second column contains all countries, states, counties and cities (all should be in one column) ORDERED within groups for the second column.
    There some other columns from other tables.
    1 USA
    2 MI
    3 MONROE
    4 MONROE
    3 WAYNE
    4 INKSTER
    4 WAYNE
    2 VA
    3 HENRICO
    4 RICHMOND
    1 WEST INDIES
    2 ...
    I am working on Oracle 9i Release 2. Please help.
    Thanks.

    A cursor would be one way to handle this...loop through the rows or you could use decode like so:
    select level, decode(level, 1, nvl(cr.country_name, 'NULL'),
                                2, nvl(st.state_name, 'NULL'),
                                3, nvl(ct.county_name, 'NULL'),
                                   nvl(ci.city_name, 'NULL'))
      from country_master cr, state_master st, county_master ct, city_master ci
           ((select 1 level, t_country_sl_no, 0 t_state_sl_no, 0 t_county_sl_no, 0 t_city_sl_no
              from mapping_table
             group by country_sl_no)
            union all
            (select 2 level, t_country_sl_no, t_state_sl_no, 0 t_county_sl_no, 0 t_city_sl_no
              from mapping_table
             group by country_sl_no, state_sl_no)
            union all
            (select 3 level, t_country_sl_no, t_state_sl_no, t_county_sl_no, 0 t_city_sl_no
              from mapping_table
             group by country_sl_no, state_sl_no, county_sl_no)
            union all
            (select 4 level, t_country_sl_no, t_state_sl_no, t_county_sl_no, t_city_sl_no
              from mapping_table))
    where t_country_sl_no = cr.country_sl_no
       and t_state_sl_no = st.state_sl_no (+)
       and t_county_sl_no = ct.county_sl_no (+)
       and t_city_sl_no = ci.city_sl_no (+)
    order by cr.country_name, st.state_name, ct.county_name, ci.city_name;

  • How do I change the sort order in the file picker?

    Hi there,
    I've recently hit a problem with the Save and Open dialogs in Mavericks. Some how I have changed the sort order within the Column View so that it sorts by modified date and no longer by name. Unfortunately I can't work out how that happened or how to get it back so that it sorts by Name.
    Please could anyone help?

    Normally, you click on this thing (shown below) and select the sorting preference.

  • How to change sort order in Notes?

    I just installed the new Mac OS X Mountain Lion and found the self-contained Desktop-App for Notes.
    But how do I sort my notes alphabetically???
    Using Mac OS X Lion I could change sort order within the mail-application. Btw I would love to sort my notes on my iPad and iPhone as well! It is possible via browser on the iCloud-Website - but the sort order is not transfered to iOS or the new Desktop-App!!
    Can anybody help, please? Apple???

    View > Sort By > Title

  • Secondary sort order

    I can sort my playlist. But when I sort them in, say "My rating" order, how can I prevent all songs from one artists rated equally being bunched together. What actually decides the sort order within, say, 5 star songs in this case?
    PC   Windows XP Pro  

    No, "limit to N selected by <attribute> will not work, at least I can not figure out to use it to do it. I tried to use "random" as the attribute, but I casn not make it work in a useful way.
    PC AMD Sempron 1,7 GHz 512 MB 140 GB 17" CRT Windows XP Pro iPod Color 30 Gb, 6500 pirated + 20 bought songs

  • Genre sort in Browser, auto sync, sort order

    I just updated to 3.1.1 and iTunes 9.0. Now Genre is missing in the browser. How can I get it back? Also none of my playlist sync in auto. I have to manually manage it. I rarely use it for music, just for listening to stories and podcasts, so it's important to have them in the correct order for listening, i.e. chapters. Now the playlist doesn't show up on the itouch sorted correctly.
    1. Doesn't have Genre in Browser. 2. Doesn't auto sync. 3. Sort order is messed up between iTunes and iTouch. 4. Is it caused by 3.1.1 or iTunes 9.0? Does anyone know how to fix these issues? I don't have an old download of iTunes 8 to uninstall 9 and reinstall 8. iTouch 3.1.1 can't be uninstalled. Shadow

    shadow1953 wrote:
    1. Doesn't have Genre in Browser.
    iTunes 9 changed the browser to a column on the left side (by default), but you can go back to how it was on top, see the View/Column Browser menu. You can have multiple filters (Artist, Album, Composer, etc.) either as a column on the left, or across the top.
    shadow1953 wrote:
    2. Doesn't auto sync.
    You have to be doing something wrong since auto-sync does work. Make sure your iPod is in auto-sync mode -- if you change the sync mode, make sure you click the "Apply" button -- if you don't, it won't change. If you're not syncing your entire library, then make sure that you've selected the playlists you want loaded onto the Touch.
    shadow1953 wrote:
    3. Sort order is messed up between iTunes and iTouch.
    Are you referring to the sort order within a playlist, or the sort order of all your playlist names? I know that the playlist name sorting has changed (again) such that punctuaion comes first, then letters, then numbers. If you're referring to the sort order of the items within a playlist, then it may be a bug -- there are reports of problems with the sorting of podcasts within playlists, so maybe the same is true for books?
    shadow1953 wrote:
    4. Is it caused by 3.1.1 or iTunes 9.0? Does anyone know how to fix these issues?
    Not sure, could be either.
    shadow1953 wrote:
    I don't have an old download of iTunes 8 to uninstall 9 and reinstall 8. iTouch 3.1.1 can't be uninstalled.
    You can get down-rev versions of iTunes at sites like filehippo (there are others). Keep in mind though that your "iTunes Library.itl" file was changed with iTunes 9 and is not backward-compatible. You'll have to look for the old .itl file in your "Previous iTunes Libraries" folder (check the date of these .itl files). If you fid the .itl file from iTunes 8, just replace the current one and then uninstall iTunes as well as "Apple Mobile Device Services" and Quicktime, then install iTunes 8.
    You can go back to a prior OS version on your Touch if you have the native file (you would if you previously did a firmware update, it stays on your computer). If you updated to 3.0 then you can go back to it by holding the SHIFT key as you click the Restore button (use the OPT key on a Mac) and then select the 3.0 version. You can't go back to 2.x in this manner, but there is a different way to go back to 2.x if you ever want to (won't go into that here).

  • Alphabetize Song Title Sort Order Under Genre on iPod

    Here is the general idea of what I am trying to do on the iPod.  When viewing songs on the iPod, if I select Genre from the main menu, I cannot find a way to display all the song titles in a selected genre in alphabetical order.  This can be done easily with the songs in iTunes on the laptop or desktop but seemingly not in the iPod.  There is no big problem if you have only a handful of songs in any one genre but if you have several hundred songs in a particular genre and titles do not display in alphabetical order, then finding a desired song is very time consuming and necessitates scrolling through the entire list.  Is there a way to alphabetize the song title sort order within Genre on the iPod?

    Get external hard drive.  Backup all your music files and wipeout iTunes from computer.   The. Reinstall and update version if necessary. The. Connect external hard drive and set hard drive folder at default in iTunes preferences.  Transfer music to library and when prompted hit automatic organizing z
    .  Should take care of your problem

  • How can I sort photos within an event? When I follow the Help instructions, I can sort manually in Photo format, but when I return to Event format, the original order is restored.

    How can I sort photos within an event? When I follow the Help instructions, I can sort manually in Photo format, but when I return to Event format, the original order is restored.

    Events are organisation for those who can't really be bothered. They are automatic - based entirely on Date and Time the camera records the photos as taken.
    You can move photos between Events, you can Merge Events, you can Rename them and sort them in various ways except one: You cannot manually sort in an Event as Events are all automated.
    If you want to manually sort in an Event then you've outgrown Events as an organising tool. Now it's time to look at albums (Where you can manually sort) which are much more flexible than Events as an organising tool.

  • Group by sort order and display accordingly

    I have two groups - primary sort order and a secondary sort order in my report, formula for both follows:
    If {?Sort Order}='1' then {PRODUCT_CUSTOMER_MNT_V.CUSTOMER_NAME}
    else if {?Sort Order}='2' then {PRODUCT_CUSTOMER_MNT_V.PRODUCT_ID}
    else if {?Sort Order}='3' then {PRODUCT_CUSTOMER_MNT_V.CUST_REVISION_LEVEL}
    else if {?Sort Order}='4' then {PRODUCT_CUSTOMER_MNT_V.CMS_UD36}
    else if {?Sort Order}='5' then {PRODUCT_CUSTOMER_MNT_V.CMS_UD38}
    else if {?Sort Order}='6' then totext(year({PRODUCT_CUSTOMER_MNT_V.PURCHASE_DATE}),0,"")"/"
    right("0" + totext(month({PRODUCT_CUSTOMER_MNT_V.PURCHASE_DATE}),0,""),2)"/"
    right("0" + totext(day({PRODUCT_CUSTOMER_MNT_V.PURCHASE_DATE}),0,""),2)
    Groups are suppressed and fields are placed in the detail the line.  I have a request to group by Customer name with selected product ID's listed or vice versa.   My quandry is how do I accomodate the descriptive fields in the page header since the user can select any number of combinations using the sort order parameter.  Sure, right now they are only looking at customer and product ID but let's face it, that requirement could change in the future.  Seems simple enough but it's been awhile since I've touched reports and my brain is fuzzy.  Is what I'm trying to do possible?   Crystal XI (11.0.0.1282)

    I was overthinking the problem.  The report was already sorting on customer or product based on user selection.  I placed the customer ID/Name field and the Product ID field into group one and checked the underlay following section box in section expert.  This is will work fine for our purposes.

  • Sort order of files when opening a document within a program

    When opening Explorer, files are correctly sorted in alphabetical order.
    When opening a document (say within Word), if I search a folder then the files/folders are in a strange sort order - something like last used or modified. I don't know how this happened. I want them sorted alphabetically like in Explorer.
    What do I need to do? I'm fed up of having to sort every folder each time I open it within a program.

    > Is there a way to change the way DW sorts the dirs and
    files in the file list
    > window (other than reversing it)?
    have you expanded the Files Panel, made the sort by clicking
    on the
    headings, then collapsed it?
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Russian and English combined Index Group Title and sort order

    How should I create the combined index Group Title and sort order in Russian and Greek documentations?

    The final product one Russian manual which contains some English Index marker ...
    And what is the problem?
    You can control the sorting by placing a [...] tag in the Marker Text, such as:
    [Сплайн] Spline
    The term(s) in the brackets are used only for sort. What appears in the Index is the following text.
    Or you can just edit the Marker Text.
    But it sounds like there might be more than one question here, re: Group Titles.

  • Sort within group

    I have several groups within groups, and on my last grouping:
    <?for-each-group:current-group();./TASK?>
    I'd like to sort alphabetically by task, but can only seem to sort on the highest group I have:
    <?for-each-group:G_DEPT;./DEPT?><?sort:DEPT;'ascending';data-type='text'?>.
    Is it possible to sort on the current group task? I just get a dump when I try to add the sort tag after for each statement.
    thanks

    I'm not sure about your <?for-each-group?> element because I haven't seen your data. This is an example from one of my reports.
    <?for-each-group: current-group();ELEMENT_NAME?>
    <?for-each:ELEMENT_NAME?>
    <?sort:PROC_PRIORITY?>
    HTH
    - Dan Stober
    Salt Lake City

  • Sort order in list wrong: in CAML and in view

    Hello,
    When I order my list with document sets by ID, the order is wrong. It is wrong in the list and with caml.
    This is my view (I just set the sort on the ID column):
    The first 4 objects are created by the Client Object Model; the last 4 are created by a SharePoint webpart that I developped myself...
    My code for creating document sets in COM is something like this:
    ListItemCreationInformation newItemInfo = new ListItemCreationInformation
    UnderlyingObjectType = FileSystemObjectType.Folder,
    LeafName = _strLeafname // = date in format YYYYMMDDhhmmss
    ListItem newListItem = myList.AddItem(newItemInfo);
    newListItem["ContentTypeId"] = targetDocumentSetContentType.Id.ToString();
    newListItem["Title"] = title;
    newListItem.Update();
    clientContext.Load(myList);
    clientContext.ExecuteQuery();
    The code in the webpart is this:
    SPContentType docsetCt = myLst.ContentTypes[p.GetFromResourcefile("xxxxxxxxxxxxxx")];
    Hashtable properties = new Hashtable
    {"DocumentSetDescription", ""},
    {"Title", txtTitle.Text}
    SPFolder parentFolder = myLst.RootFolder;
    int newId = GetLastId(myLst) + 1;
    DocumentSet ds = DocumentSet.Create(parentFolder, newId.ToString(CultureInfo.InvariantCulture), docsetCt.Id, properties, true);
    ds.Item["Title"] = title
    ds.Item.Update();
    why is the sort order wrong?
    if i do this query in the U2U Caml builder, the order is also wrong
    <OrderBy><FieldRef Name='ID' Ascending='FALSE' /></OrderBy>
    if i order by "created", the order is also wrong....
    i don't get it....

    Document Sets are great tools for grouping multiple documents together. However, if every set has exactly one document, it would be better to just upload the file and not place it within a Document Set:
    Uploading documents using object model - http://msdn.microsoft.com/en-us/library/office/ms454491(v=office.14).aspx
    Uploading documents using web services -
    http://cecildt.blogspot.com/2010/10/upload-documents-to-sharepoint-2010.html
    If you have requirements to use Document Sets, keep in mind that this adds a layer of complexity beyond a simple Document Library. Behind the scenes, each Document Set is treated as a separate folder, and although can you query items within it, there might
    be extra steps for getting the sort order to ignore the folder structure. Can you try setting the Scope to be "Recursive" and also specify that you are looking only for files and not folders:
    <Eq><FieldRef Name='FSObjType'/><Value Type='Lookup'>1</Value></Eq></Where>
    Dimitri Ayrapetov (MCSE: SharePoint)

  • ORDER BY/GROUP BY in XSL/T

    SCENARIO 1:
    Hello all!
         I have got an XML file which contains a list of products. I transform this file into an HTML page using an XSL stylesheet. The XML file looks like the following:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <products>
         <product id="40117" date="20030228">
              <issuer code="A-08244998">MECALUX, Inc.</issuer>
              <description>This is product 4117 description</description>
         </product>
         <product id="31007" date="20030228">
              <issuer code="A-19728222">REDBERRY TECH, Inc.</issuer>
              <description>This is product 31007 description</description>
         </product>
         <product id="4844" date="20030227">
              <issuer code="A-94847402">JYL SOFT, SA.</issuer>
              <description>This is product 4844 description</description>
         </product>
         <product id="3711" date="20030227">
              <issuer code="A-74185296">SOFTEC, Inc.</issuer>
              <description>This is product 3711 description</description>
         </product>
         <product id="566" date="20030226">
              <issuer code="A-08244998">MECALUX, Inc.</issuer>
              <description>This is product 566 description</description>
         </product>
         <product id="41621" date="20030226">
              <issuer code="A-74185296">SOFTEC, Inc.</issuer>
              <description>This is product 41621 description</description>
         </product>
    </products>
    I would like to order the file by date and then by product id. So the list I'll generate in HTML would have a heading with the date of the products (from most recent to oldest) and then another subheading product-id / Issuer name ordered by ascending product id, like this:
    ---------------- DATE: 2/28/2003 ------------------------
    Product-ID     Issuer Name
    31007 REDBERRY TECH, Inc.
    40117 MECALUX, Inc.
    ---------------- DATE: 2/27/2003 ------------------------
    Product-ID     Issuer Name
    3711 SOFTEC, Inc.
    4844 JYL SOFT, SA.
    ---------------- DATE: 2/26/2003 ------------------------
    Product-ID     Issuer Name
    566 MECALUX, Inc.
    41621 SOFTEC, Inc.
    To sort the data from within the XSL stylesheet I'd use:
         <xsl:apply-templates select="product">
              <xsl:sort select="@date" data-type="number" order="descending"/>
              <xsl:sort select="@id" data-type="number" order="ascending"/>
         </xsl:apply-templates>
    I'd like to write only once the date heading for each product with the same date. Template "product" would output the information of the current product, formatting it as an HTML table row.
    MY QUESTION: How can my stylesheet "remember" the date of the last product processed to know whether I should output a new heading with the date of the current product? The idea is to code the "IF" statement and the use of variable "last_date" but I don't know how in XSL/T.
    Any help would be highly appreciated.
    Thanks in advance.
         last_date = ""
         WHILE there are products DO
              product = GET_NEXT_PRODUCT
              IF product.date != last_date THEN
                   WRITE_DATE_HEADING( product.date )
                   last_date = product.date
              END-IF
              WRITE_PRODUCT_INFO( product )
         END-WHILE
    SCENARIO 2:
    Let's supose the following XML file. I'd like to generate an HTML page
    with a list of products ORDERED BY product description and GROUPED BY
    category name.
    The listing would look like the following:
         Category 1
              product-description [product-id], isuer name
         Category 2
              product-description [product-id], isuer name
         Category 3
              No products at stock
         Category 4
              product-description [product-id], isuer name
    MY QUESTION: The XML file may not be ordered by any criteria. How could I order and group the data in this case? Would it be simpler/easier if the XML file were ordered (or semi-ordered) in any way?
    The XML file would look like the following (note that there are no
    products of category 3):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <stock>
         <categories>
              <category id="C1">Category 1</category>
              <category id="C2">Category 2</category>
              <category id="C3">Category 3</category>
              <category id="C4">Category 4</category>
         </categories>
         <products>
              <product id="40117" date="20030228" category="C4">
                   <issuer code="A-08244998">MECALUX, Inc.</issuer>
                   <description>This is product 4117 description</description>
              </product>
              <product id="31007" date="20030228" category="C4">
                   <issuer code="A-19728222">REDBERRY TECH, Inc.</issuer>
                   <description>This is product 31007 description</description>
              </product>
              <product id="4844" date="20030227" category="C2">
                   <issuer code="A-94847402">JYL SOFT, SA.</issuer>
                   <description>This is product 4844 description</description>
              </product>
              <product id="3711" date="20030227" category="C4">
                   <issuer code="A-74185296">SOFTEC, Inc.</issuer>
                   <description>This is product 3711 description</description>
              </product>
              <product id="566" date="20030226" category="C2">
                   <issuer code="A-08244998">MECALUX, Inc.</issuer>
                   <description>This is product 566 description</description>
              </product>
              <product id="41621" date="20030226" category="C1">
                   <issuer code="A-74185296">SOFTEC, Inc.</issuer>
                   <description>This is product 41621 description</description>
              </product>
         </products>
    </stock>

    Scenario 1
    How can my stylesheet "remember" the date of the
    last product processedYou can't do it this way, a stylesheet doesn't support the concept of global mutable variables.
    But you can apply a test on this axis "preceding-sibling::product" to see if exists a previous product with the same date.

Maybe you are looking for

  • Jabber Client for Windows. Desk phone control trouble.

    Good day! I have CUCM - version 9.1.1.20000-5, JFW version 9.2.3 build 4417 and Microsoft AD server. I have configured: 1. LDAP directory in CUCM using SSL connection 2. LDAP authentication in CUCM using SSL connection (port 636) too. All other confi

  • Glitches in Lion - is there a solution or should I go back to SL?

    I'm having a lot of stupid little glitches with Lion that are unfortunately making it difficult to use. Here's a list: Netflix keeps giving me the Silverlight error prompting me to uninstall and reinstall, which I do to no avail. If I try to sign out

  • DBIF_SETG_SQL_ERROR.

    Hi Gurus, I am getting this error with the short dump(in ST22) DBIF_SETG_SQL_ERROR. I have attached the details of the dump. You help on this would be highly appriciated. Thanks & Regards S Kumar Runtime Errors         DBIF_SETG_SQL_ERROR Date and Ti

  • Where is "save as Adobe pdf "in backstage for word 2013

    Hi, I saw "save as adobe pdf" in the file tab in office 2013 for some users but I dont know how can I aktive it for my pc?

  • Trojan Horse pakes?

    I have some sort of Trojan horse on my iMAC (running Mavericks 10.9.5). When I check the console, there are 1000s of processes going on per second and they repetitively say: "10/13/14 7:51:53.579 AM proxyhost[22202]: 67.198.140.250:2122 - - [13/Oct/2