Sorting a cross tab total

I am a newcomer (user) to Discoverer so would appreciate some help.
I have written a cross tab report which shows my sales people in the rows and different sales catagories in the columns. I have then put a total on my rows (total for each sales person) which works fine.
I then want to sort my sales people by their "total sales" ie my calculation.
Looking in the sort functionality I appear to only be able to sort the sales people by each of the actual columns of data which come back in the report (ie the sales categories - cat 1 or 2 as below)
E.g
Cat 1 Cat 2 Total
Sales Man 1 10 15 25
Sales Man 2 15 30 45
I want to sort so that the 45 is viewed and Sales Man 2 is sorted to the top.
Help?
Ed

Hi,
Sorting a crosstab how you want is always difficult. If you only ever want two categories as column headers then it will be easier to use a table report and decode out the categories and sort by the total.
Otherwise you will have to use a analytic sum with a partition to calculate the total for each sales in a calculation and then include that calculation as a dimension. You will then be able to sort the crosstab using this dimension and if necessary hide the content of the field using formatting.
Rod West

Similar Messages

  • Sort in Cross-Tab report

    I have a cross-tab report that lists dates as headers and employees as rows. The data at every cell shows the qty (it is like timesheet report). The totals are shown for every row and column. The report layout looks something like this:
    ----------- <date> <date> <date> .... <Total>
    <name> <qty> <qty> <qty> <qty>
    <name> <qty> <qty> <qty> <qty>
    <name> <qty> <qty> <qty> <qty>
    <Total> <qty> <qty> <qty> <qty>
    The report definition looks like this (I numbered the columns to make it easier to write about them):
    01: <?horizontal-break-table:1?>
    02: <?for-each-group@column:EMPLOYEE_TIME;./TRANSACTION_DATE?><?sort:TRANSACTION_DATE;'ascending';data-type='date'?>
    03: <?TRANSACTION_DATE?>
    04: <?end for-each-group?>
    05: <?for-each-group:EMPLOYEE_TIME;./EMPLOYEE_NAME?><?sort:EMPLOYEE_NAME?><?variable@incontext:G1;current-group()?>
    06: <?EMPLOYEE_NAME?>
    07: <?for-each-group@cell://EMPLOYEE_TIME;./TRANSACTION_DATE?>
    08: <?sum ($G1[(./TRANSACTION_DATE=current()/TRANSACTION_DATE)]/TRANSACTION_QTY)?>
    09: <?end for-each-group?>
    10: <?sum ($G1/TRANSACTION_QTY)?>
    11: <?end for-each-group?>
    12: <?variable@incontext:T;.//EMPLOYEE_TIME?>
    13: <?for-each-group@cell://EMPLOYEE_TIME;./TRANSACTION_DATE?>
    14: <?sum (current-group()/TRANSACTION_QTY)?>
    15: <?end for-each-group?>
    16: <?sum ($T/TRANSACTION_QTY)?>
    The XML data is not sorted in any way and the report sorts it by employee and date. As you see at the line 02 I applied the sort by the transaction date. The sort works as expected, however the actual QTY are not showing at correct cells. If I remove sort it works fine but the dates are in random order. I suspect it is because I sort transaction date at header level and the QTY is not aware about it. I tried to apply the sort at line 07 but it does not help.
    Does anyone has any idea how to get this report to display data correctly?

    I have a SR which has associated bug 6131270.
    Here is the latest from my SR:
    UPDATE
    =======
    Hi Tomas,
    The bug has been updated. Development has recommended
    "You also need the patch from bug 4332399 to solve the java.util.EmptyStackException. "
    Please review above bug if you have access.
    Please consider applying Patch 4332399 - XSL:SORT FAILED IN A 2 LEVEL XSL:FOR-EACH-GROUP CASE
    Backport is included in patch 5840358 for EBS customers.

  • Customized Sort for Cross-Tab Row

    I have a simple Cross-Tab on my report that needs to be sorted in a static Row order.
    My cross tab has 1 Row (Name) and 1 column (Total Sales).
      Currently the CrossTab sorts the Name Alphabetically (ASC). But I need to specify a specific order.  I have added a numeric field to my table and I assign a numeric value to the last names so that I might be able to sort the Name Row based on my "CustomSortOrder" numeric field.
    Currently it looks something like this:
    A
    B
    C
    D
    E
    I want it to be: (numeric value behind the scenes)
    C (1)
    D (2)
    E (3)
    A (4)
    B (5)
    ALL OTHERS (9999)
    I cant seem to figure out where I need to set this.  I have tried adding a group to the report. I have tried setting the Report Sort order.  I am out of ideas.
    Any help would be greatly appreciated.

    Hi Jimmy,
    Here's what you need to do :
    1) Go to the Crosstab Expert > Remove the existing 'name' field from the 'Row'
    3) Add the numeric field as the 'Row'
    4) Select the Row > Group Options > Options Tab > Customize Group Name Field > Use formula as a Group Name > Click the formula button beside and use this code:
    If {numeric_field} = 9999 then "All Others"
    else
    {Name_Field}
    -Abhilash

  • Dynamic sorting in Cross Tab Report

    I have 2 cross tabs in a report with element linking that filters data in 2nd report when I click on values in the first. I'd like a way to be able to sort the results in the 2nd cross tab in ascending or descending order dynamically.
    Please see image below (click image for better quality) for a detailed representation of the problem.
    Is this possible?

    Right click on crosstab and go to Crosstab Expert and in the columns click on "group options" button and in the options tab select "Use a formula as sort order" and write the condition like this
    if {?Parameter}="Ascending" then
    crAscendingOrder
    else
    crDescendingOrder
    Hope this helps!
    Raghavendra

  • Sorting in Cross Tab

    Hi,
    We are using the Cross Tab component in Crystal Report XI and the cross tab have the sorting option as ascending, descending and specific order.
    The Sorting order will come from the query as an parameter, in that case how do we achieve the sort order in Cross Tab or how to use the sort in specific order.
    Please provide the solution or any reference.
    Thanks in advance.

    Right click on crosstab and go to Crosstab Expert and in the columns click on "group options" button and in the options tab select "Use a formula as sort order" and write the condition like this
    if {?Parameter}="Ascending" then
    crAscendingOrder
    else
    crDescendingOrder
    Hope this helps!
    Raghavendra

  • Problems with sorting in cross tab.

    Hi,
    Can anybody help me? I use Oracle Discoverer Desktop 10.1.2
    The problem is:
    a have a cross tab in which at the left axis I have the items sorted by alternative sort. Among them there are two items with similar names, like "detail 1" and "detail 1", but with different recid and ordernumber.
    if I put only the 'name' of an item at the left axis - I see only one item with the name "detail 1", against both of them.
    if I put two colums at the left axis 'ordernumber' and 'name' - I see both, but there are additional lines with the same 'content' like:
    1     ;     100
    detail 1;     100
    2     ;     200
    detail 1;     200
    how can I avoid this and is there any way to see both item without ordernumber?
    Kate.

    Hi, Ott
    I use ordernumber only for creating alternative sort, not for publishing in the crosstab.
    Ordernumber only "prevent" me to publish the info I need correctly, if I put ordernumber in the table the duplicated rows appears.
    You see, the problem is:
    I need only the names of the details in the left axis, BUT the identical names of the details (with the different ordernumber) are displayed as one row, not as different. it is not correctly.
    what should I do to solve the problem?

  • Summarizing Cross Tab totals as Average

    Hello,
    I have summarized fields in a cross tab report as sum of, however want to average the total of one of them- is there a way to do this?
    Thanks,
    WA

    Select the crosstab field. Right click and modify summary function to average. You can change it in the crosstab expert as well

  • Cross-Tab Total, Labels

    Hi experts,
    My reports with Northwind consist of:
    Group: Country
    Rows: Region
    Columns: Order Date
    Summarized Fields: Sum of Quantity, Percentage of Sum of Quantity, Sum of @IDLT50, Percentage of Sum of @IDLT50, Percent of Sum of Quantity
    Total:  Sum of Quantity, Percentage of Sum of Quantity, Sum of @IDLT50, Percentage of Sum of @IDLT50, Percent of Sum of Quantity
    @IDLT50 Formula: If {Order_Details.ProductID} < 50 Then {Order_Details.Quantity}
    Question 1 -  Last Column's Percentage has of Sum of @IDLT50. ==> I want to calculate Sum of @IDLT50 / Sum of Quantity instead.
    Question 2 - Label of Percentage of Sum of Quantity ==> I want to append Total Quantity like as "Percentage of n=Total Quantity".
    Your kind advices would be really appreciated.
    Thanks,
    Edited by: david.hd.park on Aug 16, 2011 4:20 PM

    Hi,
    Question 1:  As Debi said doing a percentage is complcated.  Crosstabs even more so.  Instead of doing the percentage in the Crosstab go back to the designer and Right-Click the Percentage of Sum of @IDLT50 and select Format Field.  Go into the Common tab and into the Display String formula. 
    Enter in the calculation for the percentage here. 
    If Sum ({Orders_Detail.Quantity}, {Customer.Country}) <> 0 Then
        ToText ((CurrentFieldValue / Sum ({Orders_Detail.Quantity}, {Customer.Country})) / 100)
    Else "0";
    The result of this formula can only be a string which is why I've had to use ToText. 
    Question 2:  The column Labels are just Text objects.  You can double click on it and edit as normal.  Word of note, if you change the crosstab, the labels get reset. 
    Good luck,
    Brian

  • Sorting a Cross-tab in both directions

    I'm using CR2008. I have a list of doctors, facilities, and their monthly charges. If I put Doctors down the left and Facilities across the top, I can sort Doctors by order of charges descending, but I can't see how to sort Facilities the same way. Anybody know how to fix this? Thanks.
    P.S. -- works just fine in Excel, but I was hoping to convert it to CR so I could put it on the CR server.
    Edited by: Garrett Fitzgerald on May 11, 2009 1:57 PM

    It's not a subgroup. As I said at the top of the thread, Doctors are the rows, Facilities are the columns, and Charges is the summarized field.
    Excel will let me sort both the Rows and the Columns by the summarized field at the same time. Will Crystal?

  • Cross Tab Sorting

    Hi,
    I have a cross tab report, i am summarizing total amount field i.e. is JSCOUNT, i want to sort the records with this field(JSCOUNT).
    how to do the sorting in cross tab with summarizing field[JSCOUNT], please help me
    Thanks
    Venkat

    Venkat,
         I have CRXI, click on the crosstab, (Top left corner) go to Report
    about half way down, you shold see group sort expert.  If you do not,
    you may need to click somewhere else on the crosstab.
    Note:    A report must contain a summary value in order to be able to perform a Group Sort. See Summarizing grouped data.
    Use the Group Sort Expert to identify top or bottom groups (the states with the most/fewest customers in a customer report, for example). You can also identify top or bottom percentages.
    Click Group Sort Expert
    in the " For this Group Sort"  section, select all
    you should see your summary value listed, and be able to select it now.
    Hope this helps.

  • Top N sorting in a Cross Tab object

    I am looking for information on how to sort a cross tab object using a Top N filter.

    Hi Lee,
    In the cross tab report, just insert a chart, with in the data tab when you insert the data base available values then you can observe on change of record values and summary field values.
    In the record sort values we can give the sorting with the order level or Top N level.
    Let me know if you have any queries.
    Thanks,
    Naveen.

  • Can we apply sorting on Column values in Cross tab??

    Can we apply sorting on Column values in Cross tab??
    Following is the scenario with me.
    I have 2 fields and one formula.
    Fields are HostName and Username.
    Formula is status which categorizes the Authorized and Unauthorized events.
    And in the Summary Field, I am calculating the total number of events.
    In cross tab, Fields are marking the Rows of the cross tab and Formula is making the Columns(Authorized and Unauthorized ) of the cross tab.
    Since in cross tab data is grouped from left to right and sorted by default. I want to remove this default sorting and want to put sorting on the formula for Unauthorized events.
    Is there any way to fulfill this requirement?

    Hi,
    You can assign a number to each Unauthorised field e.g
    Rank   Unauthorised
    1         A
    2         BC
    3         DF
    5         TD
    6         GF
    Then add "Rank" to the crostab Columns before the Unauthorised  field. Then you can control the sorting order on your crosstab.
    Hope this helps
    Regards
    Dotun

  • Crystal Reports Cross-tab Sort?

    Hello,
    I am new to Crystal Reports and I canu2019t figure out how to sort a column on a cross-tab. 
    How can I sort in descending order the Total columns on a Cross-tab? E.g. will like to show the Product Names by the total amount of sales and not by alphabetical product name. 
    Rows: Product Name
    Columns: Region
    Summarized field: Total Sales  (this is the column I will like to have in descending order)
    If this cannot be done, what is the best way to solve this issue?
    Thanks!

    Hi Sorell,
    I tried this, I right clicked on the table border, and clicked group sort, For this group sort I choose All and selected the measure amount and descending. This sorted amount table by the total column for me based on the highest product revenue.
    Hope this helps
    Regards
    Alan

  • Cross Tab Sort and Exclusion

    I have a cross tab that maps closing dates over the prior 13 months and looks like this: 
                    Total
            Total          3,004
         Sep-08     137
         Aug-08     220
         Jul-08     251
         Jun-08     201
         May-08     168
         Apr-08     263
         Mar-08     212
         Feb-08     163
         Jan-08     142
         Dec-07     100
         Nov-07     176
         Oct-07     149
         Sep-07     109
         Jan-00     713
    I have mapped everything that is not within the prior 13 month range to Jan 1, 2000.  I have used record selection to grab records based on multiple criteria.  It looks at cases opened in the prior 13 months and cases closed in the prior 13 months.  This looks at opened and closed dates.  The 713 is just everything in the past 13 months that doesn't have a closed date.  When I don't map it to Jan-00 it displays a blank row.  I tried to do a specific order sort but when I ran my report today it did not include Sep-08, not that its difficult to add the month once a month, but is it possible to exclude Jan-00 when its printing the cross-tab and then sort the remaining ones in descending order [most recent month prior to oldest]?  I am new to Crystal Reports.  I thought it may be in the Formula as Group Sort Order and something like this
    if {@Closed Month}= date(2000,01,01) then [not sure of what function to exclude] else {@Closed Month} crDescendingOrder
    thank you all for the support so far

    Try using group selection formula like
    {@Closed Month}<>date(2000,01,01)
    to exclude JAN data.
    Regards,
    Raghavendra

  • Totals in Cross tab report

    Hi All,
    I have created a cross tab report and in this report there are 8 sub-totals.
    I need to total up the first 7 sub-totals and one more total summing up the first 8 sub-totals. Is there any in-built functions to do this.
    Thanks in advance
    Dhinesh

    Look at the Total Wizard. You should be able select the right options to have totals at different level of the data. Also give us an example what you want to achieve.

Maybe you are looking for

  • Simple question about JSF configuration

    I am using Tomcat 5.0 in Windows XP SP2. When I create a web application with JSF and put it into {tomcat_home}\webapps\, everything works perfect. But when I add a context path in Tomcat's server.xml such like <Context docBase="C:\works\java_project

  • Call a method with complex data type from a DLL file

    Hi, I have a win32 API with a dll file, and I am trying to call some methods from it in the labview. To do this, I used the import library wizard, and everything is working as expected. The only problem which I have is with a method with complex data

  • SYSVOL on Win8 Clients DFS link points to wrong path

    Since I introduced a secondary DSfW DC I experience wrong DFS paths on my only Win8 DSfW member computer, if the active path of \\domain\sysvol points to the secondary DC. It points to the sysvol on the secondary DC instead of the sysvol-msdfs. This

  • The new version of Firefox will not load at all onto my computer. Is it possible my computer is too old?

    I have been using Firefox without major problems for years but the latest update refuses to even run on my computer and I've tried everything short of reformatting. Is it possible my OS (Windows XP) won't support it?

  • Installing Analytics 1.0 Composites

    HI All: I am looking for instructions to install/load Analytics 1.0 Composites.  I have already installed Viscual Composer 6.0.  I aslo have the composites.  However, I wasn't able to find any instructions on the actual install. Imran