Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
antonrus
Contributor III
Contributor III

sorting in a different order

Hello! Please help to solve one problem. I have a table of revenue on weekdays. It displays the days of the week in order, starting from Monday. And should that be showed with the environment, ie sort in a different order, such as not allowing it (sorry, do not speak in English)

1 Solution

Accepted Solutions
tresesco
MVP
MVP

In the expression of sort tab, try something like:

Match(YourWeekField, 'Wednesday','Thuesday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday')

Or,

Dual(YourWeekField, Match(YourWeekField, 'Wednesday','Thuesday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday'))

View solution in original post

10 Replies
tresesco
MVP
MVP

Take a straight table-> Sort tab-> Allow interactive sort

antonrus
Contributor III
Contributor III
Author

Yes, this has put a tick. But now sort random string? When I try to drag them - they just do not want me to impose a filter on the day of the week.

kangaroomac
Partner - Creator II
Partner - Creator II

Hiya,

Or if you want your table sorted in a specefic way, i.e. Ascending (small to big),

  • Right Click the table
  • Properties
  • Go to the Sort Tab

tmp_sort.png

kangaroomac
Partner - Creator II
Partner - Creator II

Try sorting it on Load Order

and in your script, load the field with the dates as:

..

ORDER BY myDate ASC;

This way it will load days in ascending order, and with load order chosen in your Sort tab, should give you the days of the week in the desired order.

tresesco
MVP
MVP

You mean, users would define their won sort order? No, that won't be possible that way. Iteractive sort only allows asc or desc sort. If you want a specific order which is predefined, you can do that in an expression of sort tab.

antonrus
Contributor III
Contributor III
Author

Thank you. But now I have shows in the following order: Monday; Tuesday; Wednesday; Thuesday; Friday; Saturday; Sunday

And that should be started with the environment:

Wednesday; Thuesday; Friday; Saturday; Sunday; Monday; Tuesday

tresesco
MVP
MVP

In the expression of sort tab, try something like:

Match(YourWeekField, 'Wednesday','Thuesday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday')

Or,

Dual(YourWeekField, Match(YourWeekField, 'Wednesday','Thuesday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday'))

kangaroomac
Partner - Creator II
Partner - Creator II

Load an inline table, with something like:

* INLINE [
    Sort_Day, WeekDay
         1, 3

         2, 4
         3, 5
         4, 6
         5, 7
         6, 1
         7, 2
]
;

and link it to your loaded field, with the date field having something like

...

WeekDay(myDate) AS WeekDay

and in your front-end sort by Sort_Day Ascending.

antonrus
Contributor III
Contributor III
Author

Hooray! It works! Thank you and all who responded to my question!

(Two weeks of work - but because of this problem, the whole project was in jeopardy, but you saved it)