9 Replies Latest reply: Apr 3, 2014 10:57 PM by Suphanya Phatthawaro

# How to sort numeric by function in script?

I 'm having a problem. I want to sort numeric data (Smallest to Largest).

Example.

row     A, B, C

1     4, 8, 2

2    2, 5, 1

?(A,B,C)    Return 248  (row 1)

?(A,B,C)    Return 125  (row 2)

What a function to solve this?

Thanks for any help.

• ###### Re: How to sort numeric by function in script?

You use the Rank function in Order. You see Guide.

Regards

• ###### Re: How to sort numeric by function in script?

Could you please give me example or QVW file?

• ###### Re: How to sort numeric by function in script?

Sorting the column is possible only with resident load not directly on files.

So load the file and use order by in resident load.

Tab1:

Load * from test .xlx;

Tab2:

Load * from resident Tab1 order by Column_name asc/desc; ( silmilar to sql order by)

• ###### Re: How to sort numeric by function in script?

Thanks

But I want to sort by row and concatenate to new value.

• ###### Re: How to sort numeric by function in script?

Try to create a sample app with inline data and share here explaining expected output.

• ###### Re: How to sort numeric by function in script?

This QVW File for explain my expect output.

• ###### Re: Re: How to sort numeric by function in script?

One way could be like attched sample.

• ###### Re: How to sort numeric by function in script?

What logic are you using to transform the data.

If 312 is to be transformed as123 then how 488 remains unchanged and 991 changed to 199

• ###### Re: How to sort numeric by function in script?

Because  312 sort by ascending order = 123

488 sort by ascending order = 488

991 sort by ascending order = 199