Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
juliakhaa
Creator
Creator

Sorting the values

Hello!

I have this script->

Table_name:

load

(week(created+Interval#(3, 'hh')) & ' week (' &WeekStart(created+Interval#(3, 'hh')) & ' - ' & WeekEnd(created+Interval#(3, 'hh')) & ')') as week,

row_id,

created,

WeekEnd(created+Interval#(3, 'hh')) as WeekEnd

;

select created, row_id

FROM table

where (created+ interval'3 hour') >='$(vDateZagr)'and

;

Next I create a table and sort by expression by the WeekEnd field. However, 1 week and 53 weeks have the same values, but how do I swap them so that 1 week goes after 53

 

3 Replies
WildmoserGeorg
Contributor III
Contributor III

Personally, I find another "Year_Week" column in the table useful. I always use this for sorting.

juliakhaa
Creator
Creator
Author

My field (week) returns like - 1 week (26.12.2022 - 01.01.2023). All weeks are different, but week 53 is exactly the as 1. 
but I need 53 to go before 1 in the table

vinieme12
Champion III
Champion III

Sort by Week field by Expression = Max(Datefield)

 

Refer this article on broken weeks

https://community.qlik.com/t5/Design/Redefining-the-Week-Numbers/ba-p/1467199

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.