Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
garyvary123
Contributor III
Contributor III

Sorting by Quarter Year

Hi guys, I want to sort my tables, graphs and everything else in order by Quarter and Year. The desired format is the following:

1Q19, 2Q19, 3Q19, 4Q19, 1Q20, 2Q20, 3Q20, 4Q20 etc..

What I'm getting is:

1Q19, 1Q20, 1Q21, 1Q22, 2Q19, 2Q20, 2Q21, 2Q22 etc..

I've used a brute force method but would like to make it dynamic. Would appreciate any help.

=match([Date],'1Q18', '2Q18', '3Q18', '4Q18', '1Q19', '2Q19', '3Q19', '4Q19')

1 Solution

Accepted Solutions
Or
MVP
MVP

Use Dual() to give each quarter its underlying date or numeric value. If you aren't tied to this specific format, Qlik has a built-in Quartername() function as well, but it won't match the format you're currently using.

From this specific format, you could probably do something like num(Right(Quarter,2) & left(Quarter,1)) for the numeric part of the dual(), but if you have the underlying date you could just use that.

View solution in original post

1 Reply
Or
MVP
MVP

Use Dual() to give each quarter its underlying date or numeric value. If you aren't tied to this specific format, Qlik has a built-in Quartername() function as well, but it won't match the format you're currently using.

From this specific format, you could probably do something like num(Right(Quarter,2) & left(Quarter,1)) for the numeric part of the dual(), but if you have the underlying date you could just use that.