hexagon logo

sorting results

Hello,
I have 23 different width measurements and I would like to see them in report from minimum to maximum. How could I do that?

Thanks in advance


Attached Files
Parents
  • There's also the function MININDICES(array) which gives you an array of the indices in sorted order. This can be used to read multiple arrays in the sorted order. Example:

    V1 is an array of names, V2 is an array with the corresponding values
    V3 becomes an array of indices - how to read the V1 and V2 arrays in the same sorted order.

    ASSIGN/V1=ARRAY("b", "a", "ab", "ba", "aaa")
                ASSIGN/V2=ARRAY(13,   3,   234,  345,  74)
                ASSIGN/V3=MININDICES(V2)
                COMMENT/REPT,
                "Name: " + V1[V3[1]] + "   Value: " + V2[V3[1]]
                "Name: " + V1[V3[2]] + "   Value: " + V2[V3[2]]
                "Name: " + V1[V3[3]] + "   Value: " + V2[V3[3]]
                "Name: " + V1[V3[4]] + "   Value: " + V2[V3[4]]
                "Name: " + V1[V3[5]] + "   Value: " + V2[V3[5]]


    and the result is:

    Name: a   Value: 3
    Name: b   Value: 13
    Name: aaa   Value: 74
    Name: ab   Value 234
    Name: ba   Value: 345
    


    Beware: It seems the SORTxxx() and xxxINDICES() functions only sort numerical values, they can not be used to sort the above arrays in name order (at least not in 2018 R2 SP1)!
  • Just start a thread in Tips&Tricks and either link to relevant posts, or copy them...
    Then start lobbying to get it stickified...
Reply Children
No Data