Dash in sort value is skewing sort

Hi All,
I've noticed that having dashes in an alphanumeric sort field causes the data not to be sorted correctly:
A-
AA
A-B
AC
A-C
A simple Crystal formula highlights the issue:
    StrCmp ("A-B","AAA")   returns 1, i.e. "A-B" is greater than "AAA", but
    StrCmp ("A-A","AAA")   returns -1, i.e. "A-A" is less than "AAA".
I know I can work around this by manipulating the data but with hundreds of reports containing multiple groups and sort values this is not practical. Is there some setting or collating sequence I need to set? Why is it doing this?
I'm running CR XI R1 SP3 on Windows Vista. I also get the same result in CR 8.5.
Thanks in advance,
Michael.

"Your are so right, but this is not unique to crystal. Excel sorts this values exactly the same"
I think we're now getting to the bottom of the issue. I assume Crystal has based it's sort logic on Excel (N.B. Access does not sort this way). Why they would want to do this I don't know but maybe SAP can confirm. IMHO it would be much better to sort using the normal ASCII values, or at least have an option to do this.
Some further research on sorting in Excel:
Default sort orders In an ascending sort, Microsoft Office Excel uses the following order. In a descending sort, this sort order is reversed.
Value Comment
Numbers Numbers are sorted from the smallest negative number to the largest positive number.
Dates Dates are sorted from the earliest date to the latest date.
Text Alphanumeric text is sorted left to right, character by character. For example, if a cell contains the text "A100," Excel places the cell after a cell that contains the entry "A1" and before a cell that contains the entry "A11."
Text and text that includes numbers stored as text are sorted in the following order:
0 1 2 3 4 5 6 7 8 9 (space) ! " # $ % & ( ) * , . / : ; ? @ \ ^ _ ` { | } ~ + < = > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Apostrophes (') and hyphens are ignored, with one exception: If two text strings are the same except for a hyphen, the text with the hyphen is sorted last.
Note If you have changed the default sort order to be case-sensitive through the Sort Options dialog box, then the order for alphabetic characters is the following: a A b B c C d D e E f F g G h H i I j J k K l L m M n N o O p P q Q r R s S t T u U v V w W x X y Y z Z
Logical In logical values, FALSE is placed before TRUE.
Error All error values, such as #NUM! and #REF!, are equal.
Blank cells In both an ascending and descending sort, blank cells are always placed last.
Note A blank cell is an empty cell and is different than a cell with one or more space characters.
http://support.microsoft.com/kb/212144
http://support.microsoft.com/kb/322067
Edited by: micmac on Jun 30, 2010 12:35 PM

Similar Messages

  • How to display the sort value in the selection screen in the report title

    Dear All,
    How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
    Good day,
    Thanks and regards
    Arun S

    Hi Arun,
    Try this.
    1, Set one dynamic parameter,
    2, Drag and drop that parameter into  your report title.
    3, Pass the value(sort value) dynamically from your application,
    4, Cheers..
    Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then  set the data source from CR designer. and darg and drop that data column into the report.
    Hope this will work,
    Regards,
    Salah
    Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM

  • How to show values with initial sort asc/desc in 11.5.10 iProcurement page?

    (Logged Bug 12902576 with OAFramework DEV, but OAF DEV closed the bug and advised to log the issue here in the forum)
    How to have values sorted in ascending order when user first navigates to the page?
    Currently the values are unsorted, and are only sorted after the user clicks the column heading to sort the values. We expect the users should not have to click the column heading, but instead that the values should be sorted in ascending order when the user navigates to the page. This issue occurs on an OAFramework based page in iProcurement application.
    PROBLEM STATEMENT
    =================
    Receipts and Invoices are not sorted in iProcurement Lifecycle page even after implementing personalization to sort ascending on Receipt Number and Invoice Number. Users expect the receipts and invoices to be sorted but they are not sorted.
    STEPS TO REPRODUCE
    1. Navigate to iProcurement
    2. Click the Requisitions tab
    3. Search and find a requisition line that is associated to a Purchase Order having multiple receipts and multiple invoices.
    4. Click the Details icon to view the lifecycle page where the receipts and invoices are listed
    - see that the receipts are not sorted, and the invoices are not sorted
    5. Implement personalization to sort in ascending order for Receipt Number and for Invoice Number. Apply the personalization and return to page.
    - the receipts and invoices are still not sorted.
    IMPACT
    Users need the receipts and invoices sorted to make it easier to review the data. As a workaround, click the column heading to sort the results
    Tried workaround suggested by OAFramework DEV in Bug 12902576 but this did not help.
    TESTCASE of suggested workaround
    NAVIGATION in visprc01
    1. Login: dfelton / welcome
    2. iProcurement responsibility / iProcurement Home Page / Requisitions tab
    3. Click the Search button in the upper right
    4. Specify search criteria
    - Remove the 'Created by' value
    - Change 'Last 7 Days' to 'Anytime'
    - Type Requisition = 2206
    5. Click Go to execute the search
    6. Click the Requisition 2206 number link
    7. Click the Details icon
    8. In the Receipt section, click the link 'Personalize Table: (ReceivingTableRN)'
    9. Click the Personalize (pencil) icon
    10. Click the Query icon for Site level (looks different than the screenshots from OAFramework team, because this is 11.5.10 rather than R12
    - Compare this to the Table personalization page show in the reference provided by OAFramework team -
    http://www-apps.us.oracle.com/fwk/fwksite/jdev/doc/devguide/persguide/T401443T401450.htm#cust_persadmin_editperprop
    11. See on the Create Query page
    Sorting
    No sorting is allowed
    The Query Row option becomes available in personalize after setting the Receipt Number row to Searchable. However, even after clicking the Query icon to personalize, it is not possible to specify sorting. There is a Sorting heading section on the personalization page, but there is also a statement: No sorting is allowed
    The workaround mentioned by OAFramework team in Bug 12902576 does not work for this case
    - maybe because this is 11.5.10 rather than R12?
    - maybe similar to Bug 8351696, this requires extension implementation?
    What is the purpose of offering ascending/descending for Sort Allowed if it does not work?
    Please advise if there is a way to have the initial sort in ascending order for this page.

    I´m sorry that you couldn´t reproduce the problem.
    To be clear:
    It´s not about which symbol should seperate the integer part from the fraction.
    The problem is, that i can´t hide the fraction in bargraph.
    The data im showing are integers but the adf bar graph component wants to show at least 4 digits.
    As I´m from germany my locale should be "de" but it should matter in the test case.
    You can download my test case from google drive:
    https://docs.google.com/open?id=0B5xsRfHLScFEMWhUNTJsMzNNUDQ]
    If there are problems with the download please send me an e-mail: [email protected]
    I uploaded another screenshot to show the problem more clear:
    http://s8.postimage.org/6hu2ljymt/otn_hide_fraction.jpg
    Edited by: ckunzmann on Oct 26, 2012 8:43 AM

  • Ssrs 2008 r2 pass paramter value to a sort

    In a new SSRS 2008 r2 report, I am going to be using sql within a dataset and not a stored
    procedure since will I need to pass multiple values to each parameter.
    One of the parameters that I will be working with is allowing the user to be able to pick what items
    they want to sort on. The sort will have 3 items that will be always be sorted on first which are:
    year, and school_number.  The users will be able to pick additional items to sort on like grade, and teacher.
    The following is the sql that I have so far:
    select year,  school_number, grade,teacher,room,course_number, course_name
    from dbo.school
    order by  year,  school_number, several parameter values.
    Thus I am wondering if you would modify the sql above so that I can allow the user to sort on the additional parameters in any order like grade,teacher,room,course_number, course_name?
    If any part of my request is not possible, I am wondering if you would show me what is possible in the sql?

    Hi jazz_dog,
    According to your description, you want to sort the report by grade,teacher,room,course_number or course_name based on a parameter selection. If in this case, we can add an expression in sorting to achieve your requirement:
    Add a parameter named Sort with the available values below to the report:
    Label: grade                                       Value: grade
    Label: teacher                                     Value: teacher
    Label: room                                        Value: room
    Label: course_number                         Value: course_number
    Label: course_name                            Value: course_name
    Add a the expression below to the tablix Sorting:
    =switch(Parameters!Sort.Value="grade",Fields!grade.Value,Parameters!Sort.Value="teacher",Fields!teacher.Value,Parameters!Sort.Value="room",Fields!room.Value,Parameters!Sort.Value=" course_number",Fields!course_number.Value,Parameters!Sort.Value="course_name",Fields!course_name.Value)
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • PLD sorting values

    Hello
    I have a question
    End of the mmonth we make an invoice combining all delivery notes
    On the PLD I have storted Delivery Note number on the repetitive area (sort value) but in the same group I want the date and document reference remark to appear
    I have sometimes the date and the ref text but sometimes not so the solution I have is not correct
    I have made a link fields as a formula for date and base ref
    Field 1 = Doc Base number of the row INV1
    Field 2 = Sorted value
    Formula : Field1==Field2
    The date and base ref are linked to Formula above...
    Maybe there should be another way to have everytime date and base ref to be shown in the group 1 area

    Hello gordon
    No I have not tried but to me create UDF fields which have the same information as regular field makes no sense
    What would be the advantage ?
    What UDF you mean date and doc reference right ?

  • New feature request: please show values once i sort the list in My Samples

    would like to see actual stats / values once i sort the list in My Samples, for e.g. it would be great to display the download count in the list once i sort by downloads or display the ratings once i sort by ratings, etc...
    This should be just like when i search by my name when on the samples home pg.
    hope to see this feature soon, thanks!

    I have been wanting a way to search only my threads. That would be a nice feature. I know that in the last 3,800 posts I have posted something along the line of "ZZZZ" but I can only find it by looking at most of the 3800 posts. This isn't good. I could
    narrow it down to 2000 by selecting Answered, but really I still need to search? And no don't limit my threads to any amount to make it load faster because the truth is it did not load any faster on any of the 12 machines I use.
    We are the generation of needing it all at our fingertips...Don't limit anything only facilitate us getting to the specifics we need at this second. You give someone a 1 cubic foot swimming pool and tell them that's enough cause it's all the space they can
    take up at one time anyway...Give us an ocean so we can swim in the part that is good for us but help us get there with some flippers (filters) on our own threads. And please don't tell us to use a general search on all threads...I tried to find 1 of my threads
    that way and after reading though 25 or so threads proceeded to skim the headers and after 200+ I gave up trying to find my thread because you can not unless you get really lucky.
    Thank you for your time!!!
    Chris Ward

  • Sorting values added to an array

    Hi,
    I've written some code to sort value in an array as I add them, but I can't get it to work properly. So far I have:
    public boolean add(int next)
            int last, temp, previous;
            if (size < 1) // checks whether any values have been added to determine correct value for previous.
                previous = size;
            else
                previous = size - 1;
            if (size < arraySize) //determines whether array is full or not
                last = numberList[previous];
                if (next > last)
                    numberList[size] = next;
                    size++;
                else if (next < last)
                    temp = last;
                    numberList[previous] = next;
                    numberList[size] = temp;
                    size++;
                numberAdded = true;
                return numberAdded;
            }Which does add the numbers, but they aren't arranged into the proper order. When I look over it I can't see anything that stands out as being wrong, so I was wondering whether anybody could see anything?
    Thanks for your help,

    endasil wrote:
    nickd_101 wrote:
    I don't want a loop in this case, as i want to put the values into the correct position (with respect to the previous one) as they're added into the array. Basically, my idea is that the previous value is checked against the new value and then they are swapped if the previous value is larger than the new or kept as is if not.So you're saying that if you added
    1, 2, 4, 5, 3
    you'd want the resultant order to be
    1, 2, 4, 3, 5?
    Because by your logic that's what would happen. The most that can ever happen by your logic is that a new entry would be at most 1 away from the end of the array.
    P.S. use an SortedSet, given that your code doesn't allow duplicate values anyway.
    Edited by: endasil on Nov 19, 2007 2:15 PMThanks for the response. What I meant is that I would eventually want it in ascending order 1,2,3,4,5. What I thought I was doing was sorting the comparing the new value with the preceding everytime a number was added so that it would always go in consecutive order. So, for example say the numbers were added to the array one by one in the order 3,5,4,1,2; 3 would be compared to 5 and there would be no change in the position. As i've typed this out i've just realised the massive logical error i've made! Could you point me in the right direction to get this to work as i'm new to this. I've managed to get a pre-defined array sorting as normal, but for this i need to sort everytime I add a new value?
    Thanks again

  • PLD and sort value

    Dear Expert
    Happy new year to you
    One customer makes end of the month invoice with all delivery made in the month
    We use sort value and the value is Base Doc reference in INV1 and we group by, the delivery note number is selected
    At each group we can see as header the Delievrey note number
    But we also want to see on the same header the date of delivery (actdeldate) and customer ref (BaseAtCard)for each group of delivery
    How is it possible with PLD what function to use.???
    We use SAP BO 2007 SP01 PL11

    Hi,
    PLD is a very simple tool. You probably need Crystal Report to achieve your goal.
    Thanks,
    Gordon

  • Assignment field value different from sort key

    Dear Forum,
    I notice in the customer line item, the assignment field value different from sort key.
    sort key for customer i maintain as doc number + fiscal year, but i notice some line item's assignment is not this information.
    for example, billing posting. some customer line item assignment is document + fiscal year but some are delivery number in assignment field. no changes made in log file.
    may i know why?
    thanks

    dear,
    as i did mention, customer master sort key no change and in the same customer line item, assignment field which carry delivery number also no change log.
    may i know where to see the subsitution? i do not think that is due to substitution.
    thanks

  • Sorting in dataset vs sorting in the report

    Are the some guidelines on when to use sorting in dataset vs sorting in the report?

    Hi JoeSchmoe115,
    In Reporting Services, we can add ORDER BY clause to presort data that is retrieved for a report in the dataset queries. Or we can sorting groups or sorting by aggregate values in the report. When we add ORDER BY clause to sort the data in the order we want
    it sorted in the report. Presorted data improves report processing time because of the way it is stored in memory. And there are many report processing tasks do not require sorting data before processing it. For example, SUM is not order-dependent and Data
    within group instances is not automatically sorted.
    So sorting groups or sorting by aggregate values is much simpler in the report than in the query and is frequently more efficient also. If we do not need sorted data in the report, do not set sort expressions on the dataset. For more details, please see:
    Troubleshooting Reports: Report Performance
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Table View : Sort='server' : Error=Invalid sort field type in "SORT ... AS

    Hi ,
    The Sort button does not work for GUID and it shows the error,
    <b>Invalid sort field type in "SORT ... AS TEXT"</b>
    How do I solve this problem?
    Thanks and Best Regards,
    Bindiya

    Hi ,
    Below is the code :
    IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS
    ==================================================
            ls_coldef-columnname              = 'PBI_C_VALUE_ID1'.
            ls_coldef-width                         = '150'.
            ls_coldef-title                           = 'Category I '.
            ls_coldef-tooltipheader              = 'Category I '.
            ls_coldef-wrapping                   = zcl_zsc_co=>sc_true.
            ls_coldef-edit                          = zcl_zsc_co=>sc_true.
            ls_coldef-sort                          = zcl_zsc_co=>sc_true.
            APPEND ls_coldef TO p_column_definitions.
            CLEAR ls_coldef.
    ==================================================
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
    ==================================================
        WHEN 'PBI_C_VALUE_ID1'.
          CREATE OBJECT lr_dropdown.
          lr_dropdown->id                 =  p_cell_id.
          lr_dropdown->nameofkeycolumn    = 'PBI_C_VALUE_ID'.
          lr_dropdown->nameofvaluecolumn  = 'SHORT_NAME'.
          lr_dropdown->selection          = <fs_row>-pbi_c_value_id1.
          lr_dropdown->disabled           = lv_disable.
          lr_dropdown->width              = '170'.
          GET REFERENCE OF mr_model_assign_sb_list->mr_model_pb_item_list->mr_model_def_category->mt_dropdown_cat_1_val INTO lr_dropdown->table.
          p_replacement_bee = lr_dropdown.
    ==================================================
    NOTE: the data element of 'PBI_C_VALUE_ID' is RAW 16.
    Thanks and Best Regards,
    Bindiya

  • Infopath cannot submit the form because it contains errors. Errors are marked with either a red asterik(required fields) or a red, dashed border (invalid values)

    Infopath cannot submit the form because it contains errors. Errors are marked with either a red asterik(required fields) or a red, dashed border (invalid values).
    Press Ctrl+Shift+O for next error or Press Ctrl+Shift+I for error details
    Please help me, Thank in advance.
    Sravan.

    Hi Sravan, this means that one or more of the fields are required to be filled in or have validation set up on them so that the information entered matches a certain criteria. Make sure what's entered matches what's required. If the form still can't be
    submitted, check the rules set in InfoPath and the list/library to see what's causing the error(s).
    cameron rautmann

  • Showing sort icons without applying sort to the collection in AdvancedDataGrid

    Hi All,
    We have a scenario in our application where all the sorting has to be handled by the web services and the client just needs to show the sorted data in an Advanced Data Grid.
    The web services though returns details for the column on which it is being sorted and also the sort order i.e. ASC or DESC. So based on the same we need to simply show a ASC or DESC icon on the specified column header.
    We tried different options, but it seems the sort icons only show up when sorting is actually applied to the collection. But since the sorting is to be dealt with from the web services, it is not possible to apply sorting on the client side as it may result is differentiating data.
    So, can anyone please suggest a solution for this.
    Thanks,
    Eshaan

    Hi All,
    We have a scenario in our application where all the sorting has to be handled by the web services and the client just needs to show the sorted data in an Advanced Data Grid.
    The web services though returns details for the column on which it is being sorted and also the sort order i.e. ASC or DESC. So based on the same we need to simply show a ASC or DESC icon on the specified column header.
    We tried different options, but it seems the sort icons only show up when sorting is actually applied to the collection. But since the sorting is to be dealt with from the web services, it is not possible to apply sorting on the client side as it may result is differentiating data.
    So, can anyone please suggest a solution for this.
    Thanks,
    Eshaan

  • Under View Sorting Options the Manual sort option is dimmed and not available; how do I fix?

    Under the View tab, Sorting Options, the Manual Sort is dimmed and not available to me; how do I fix?

    In an album just drag the photos where you want them. Manual sorting is not available in smart albums
    LN

  • Sorting techinque without using sort statement /Comparing table fields.

    Hi,
    How to achieve sorting techinque without using sort statement in tables.
    Also how to compare fields of 2 custom tables and check their compatability without using code ?

    Hi,
    Refer the below program, it will be helpful.
    types: begin of t_int,
             int type i,
            end of t_int.
    data: it_int type standard table of t_int,
           wa_int type t_int,
           wa_int1 type t_int.
    wa_int-int = 70.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 50.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 20.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 30.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 23.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 23.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 32.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 77.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 99.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 1.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 11.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 90.
    append wa_int to it_int.
    clear wa_int.
    wa_int-int = 40.
    append wa_int to it_int.
    clear wa_int.
    data: wk_line type i.
    data: cnt type i.
    data: cnt1 type i.
    describe table it_int lines wk_line.
    clear: cnt,cnt1.
    data wk_flag type c.
       clear wk_flag.
    while wk_line gt cnt1.
       cnt = cnt + 1.
       read table it_int into wa_int index cnt.
       cnt1 = cnt + 1.
       read table it_int into wa_int1 index cnt1.
       if wa_int-int lt wa_int1-int.
         modify it_int from wa_int index cnt1.
         modify it_int from wa_int1 index cnt.
         wk_flag = 'X'.
       endif.
       if cnt1 eq wk_line.
         clear: cnt, cnt1.
         if wk_flag eq 'X'.
         clear wk_flag.
         continue.
         else.
           exit.
         endif.
       endif.
    endwhile.
    loop at it_int into wa_int.
       write: / wa_int-int.
    endloop.

Maybe you are looking for