The column, by which we want to sort, contains an element parameter whose range is a calendar. If I sort the table by the column, it sorts as if its elements were strings, not dates.
Dear Zoltan,
You are right, in the current implementation of the Table sorting in the WebUI, there is no special treatment of ‘date’ columns, so they are indeed sorted alphabetically. I discussed this with the developer of the sorting, and he indicates that it should be possible to implement the exception. I will file an internal request for this.
He also provided a kind of workaround for this, but I cannot judge from the information in your post whether this will be good enough in your situation. The idea is to create a subset containing the whole master set and sort this subset based on the element parameter in your column. After that, slice the identifier(s) in the column(s) to this subset.
Probably this is a bit unclear from my explanation, so I have included a sample model to show this. The SortedSeasons set is the sorted subset of the master set Seasons, and in the WebUI table, both identifiers are sliced to the ss index of the subset. When sorting the SeasonName column, this behaves as expected (i.e.; alphabetically) and when NOT sorting (i.e. keep on default) the StartingDay column, it will be sorted based on the subset order, which is based on the calendar order.
Regards,
Mischa
We have adapted the code and in a next release of AIMMS (likely 4.74) will use the actual dates of the calendar elements when sorting (btw, if any custom order is added to eg a subset of a Calendar - which seems illogical - it will be ignored).
Good news
Reply
Sign up
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.