OASIS Open Document Format for Office Applications (OpenDocument) TC

 View Only
  • 1.  Sort_Index wording

    Posted 07-07-2024 11:40
    Greetings!

    I have an unrelated question on the wording of Sort_index in

    https://issues.oasis-open.org/browse/OFFICE-4157

    Sort_index: First, the column or row of Data_source that is at the index specified in the first value of Sort_index (name it "A" here) is sorted in the order specified in the first value of Sort_order. Indexing starts with 1 in the column furthest to the left or the row furthest up in Data_source. In case Sort_index has more than one value, next all columns or rows with the same value in column or row "A" are sorted in the column or row specified as the second value in Sort_index, in the order specified in the second value of Sort_order, and so on. If Sort_order has fewer values than Sort_index, the last value of Sort_order is used repeatedly.
    Default value is 1.

    Isn't the second sentence a duplicate of the first?

    First, the column or row of Data_source that is at the index specified in the first value of Sort_index (name it "A" here) is sorted in the order specified in the first value of Sort_order.

    vs.

    Indexing starts with 1 in the column furthest to the left or the row furthest up in Data_source.

    Yes?

    In case Sort_index has more than one value, next all columns or rows with the same value in column or row "A" are sorted in the column or row specified as the second value in Sort_index, in the order specified in the second value of Sort_order, and so on. If Sort_order has fewer values than Sort_index, the last value of Sort_order is used repeatedly.

    But that's an awkward way to say that values are sorted by the corresponding Sort_index value.

    Try:

    If Sort_index is an array, all columns and rows are sorted by the corresponding Sort_order value. If Sort_order is shorter than Sort_index, the last value of Sort_order is used.

    Hope everyone is having a great weekend!

    Patrick


  • 2.  RE: Sort_Index wording

    Posted 07-07-2024 14:33

    The sentence "Indexing starts with 1 in the column furthest to the left or the row furthest up in Data_source." is there, because I want to make clear, that indexing is 1-based. A 0-based indexing is common as well.

    The other sentences are my attempt to explain, that a leveled sort is done.

    When you have data

    Product   Region  Sales

    A             North     3

    B             South    4

    A             South     2

    A             North      1

    B             North     5

    With Sort_index {2\1} you get

    A   North   3

    A   North   1

    B   North   5

    A   South   2

    B   South   4

    With Sort_index {1\2} you get

    A   North   3

    A   North   1

    A   South   2

    B   North   5

    B   South   4



    ------------------------------
    Regina Henschel
    The Document Foundation
    Dortmund
    ------------------------------



  • 3.  RE: Sort_Index wording

    Posted 07-07-2024 15:08

    Regina,

    Can't we just say indexing starts with 1?

    I have a question about the second part of your example.

    On 7/7/2024 2:32 PM, Regina Henschel via OASIS wrote:
    010001908e781250-f3fdab1a-8b4f-404d-b53d-2a7932156fd2-000000@email.amazonses.com">
    The sentence "Indexing starts with 1 in the column furthest to the left or the row furthest up in Data_source." is there, because I want to make clear, that indexing is 1-based. A 0-based indexing is common as well.   The other sentences are my attempt to explain, that a leveled sort is done.   When you have data   Product   Region  Sales   A             North     3   B             South    4   A             South     2   A             North      1   B             North     5   With Sort_index {2\1} you get   A   North   3   A   North   1   B   North   5   A   South   2   B   South   4   With Sort_index {1\2} you get 
    Where did you get the 2? Sort order is limited to 1, -1.
    010001908e781250-f3fdab1a-8b4f-404d-b53d-2a7932156fd2-000000@email.amazonses.com">
      A   North   3   A   North   1   A   South   2   B   North   5   B   South   4  

    I am concerned that from the reading of Sort_order as an array, I think I can have:

    1

    1

    -1

    -1

    -1

    -1

    1

    1

    There always being two or more values as sort order makes no sense on one value.

    And if it is shorter than the Sort_index, the last value repeats.

    I've about convinced myself that the Sort_index makes sense this way because its application depends upon the data selected, etc.

    Closer, farther away?

    BTW, I noticed the duplicated language here:

    • In case By_col = FALSE, each value shall be less or equal the amount of rows in Data_Source, in case By_col = TRUE, each value shall be less or equal the amount of columns in Data_Source.


    By_col, FALSE or True, it has the same outcome? Did you mean for them to be different?


    Thanks!

    Patrick






  • 4.  RE: Sort_Index wording

    Posted 07-07-2024 15:49
      |   view attached

    {2\1} and {1\2} are arrays to be used as inline array in the UI for the parameter Sort_index. I have chosen \ as column separator, because that fits better to your English environment in case you will test the example with EXCEL. In case you will test the example with LibreOffice, you need version 24.8, that is in beta-mode currently. The UI separators for inline-arrays are customizable in LibreOffice in Tools > Options > Calc > Formula.

    Of cause in file format the column separator will be a ';' and the row separator will be a '|' as specified in section 5.13 Inline Arrays, part 4.

    I have uploaded SortExample.xlsx, which contains the example from my other post.



    ------------------------------
    Regina Henschel
    The Document Foundation
    Dortmund
    ------------------------------

    Attachment(s)

    xlsx
    SortExample.xlsx   9 KB 1 version


  • 5.  RE: Sort_Index wording

    Posted 07-07-2024 17:40

    I hope I don't forget by tomorrow but I have convinced myself about the working of

    your example!

    But my question about Sort_order remains.

    How does it interact with the behavior in your examples for Sort_index?

    Thanks!

    Patrick

    On 7/7/2024 3:49 PM, Regina Henschel via OASIS wrote:
    010001908ebe1bb9-cd1e8baa-b2ad-47c7-afbb-c259eb2261af-000000@email.amazonses.com">
    {2\1} and {1\2} are arrays to be used as inline array in the UI for the parameter Sort_index. I have chosen \ as column separator, because that... -posted to the "OASIS Open Document Format for Office Applications (OpenDocument) TC" community