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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Lucky1
Creator
Creator

Sorting by yearquarter

Hi

 

I have used below code to get quarter year

'Q' & ceil(month([Close of Business Date])/3) & '-' & Year(Date([Close of Business Date], 'YYYY')) as QuarterYear,

I want to sort like Q3-2022   Q4-2022   Q1-2023  Q2-2023   Q3-2023

how to do that

 

Labels (5)
1 Solution

Accepted Solutions
Or
MVP
MVP

Best suggestion - don't use this method. Instead, use QuarterName([Close of Business Date]), or create a dual type containing the desired naming scheme as well as the underlying date.

If you must use this, you'll have to custom sort using something like Right(QuarterYear,4) & Left(QuarterYear,2).

View solution in original post

2 Replies
Or
MVP
MVP

Best suggestion - don't use this method. Instead, use QuarterName([Close of Business Date]), or create a dual type containing the desired naming scheme as well as the underlying date.

If you must use this, you'll have to custom sort using something like Right(QuarterYear,4) & Left(QuarterYear,2).

Lucky1
Creator
Creator
Author

Hi MVP,

Thanks for reply. I want to show maxquarteryear sales in a table. I have created variable like Max( quarteryear) but it didnt help me.it is not showing max year quarter sales.Can you please help me on this