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: 
Kaushik2020
Creator III
Creator III

Custom column to show dates/Quarter label - Year

Dear All, 

I have a scenario where i get dates in CreatedDate column in my database in below format. I want to show a column named CustomDate which show the last/max date for the end month. below are the conditions for Quarters.

Q1 -> 01 Nov Previous year to Current year Feb end. refer below example dates
01-Nov-2024
27-Nov-2024
10-Dec-2024
10-Feb-2025

For these dates i want a column 

Q2 -> 01 March Current year till 31 May Current year
Q3 -> 01 June Current year till 31 Aug Current year
Q4 -> 01 Sept current year till 31 Oct Current year

 

Based on the example above, I would like to see dates in CustomDates column as below. 

28-Feb-2025

31-May-2025

31-Aug-2025

31-Oct-2025

 

Thanks in advance.

2 Replies
Or
MVP
MVP

You can use the Quartername() function to do this easily, but you'll have to add pick/match or an if() statement to control the exact formatting.

Quartername(Date,0,12) should be the right syntax, I believe, though it might be (Date,-1,12), not 100% sure and can't test right now. 

Kaushik2020
Creator III
Creator III
Author

I will wait for more suggestions in this. with SQL query it is working well. but it is taking too much time in query load. Here the issue is these months are not part of generic quarters hence we need to tag them based on the months. Your prompt revert to the post is much appreciated.