Welcome! Log In Create A New Profile

Advanced

Sort a memory table.

Posted by AadG 
Sort a memory table.
January 06, 2023 03:04PM
Hi all,

I use a memory table where I can sort the columns by clicking in the columnheader. I can fix the sort by "Store the sorts".
When I use tabledisplay(Table,X) the sort is disturbed and the original index sort is restored.

Does anyone know if this is normal behaviour and it is not possible the restore the tablesort or do I need a special parameter or function.

Best regards,

Aad
Al
Re: Sort a memory table.
January 06, 2023 04:50PM
Hello Aad,

The TableSortedColumn() function returns the name of the current sorted column. The help states that it returns a list of sorted columns but that has never happened for me.

You could save the sorted column name to a string prior to using TableDisplay and then use TableSort with the saved string value to restore the correct sort order.

Regards
Al
Re: Sort a memory table.
January 08, 2023 12:17PM
Hi Aad

My suggestion is to apply the sort to the data source and then do a TableDisplay(), this will provide you the always the desired qequencing.

Cheers

Peter
Re: Sort a memory table.
January 09, 2023 04:02PM
I agree with Peter
Do the sorting in the Query
It is the most optimal option

[infosonline.net]
Re: Sort a memory table.
January 11, 2023 10:12AM
Thanks guys,

I will try out your several options.

Best regards,

Aad
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: