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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
clarko2122
Contributor
Contributor

Quarter from Numeric Date

Hello all!  I am in need of some help - I have searched the boards and not found quite what I'm looking for.  I have a date field, '%TicketCompletedDate' that is in 5-digit numeric form, e.g. '43662' and I would like to extract the quarter from that date in the format 'Q#-YYYY' and be able to sort sequentially. (Q1-2021, Q2-2021...Q1-2022, Q2-2022, etc)  Can anyone help me with that, please?

 

Labels (1)
2 Replies
Or
MVP
MVP

Perhaps QuarterName(%TicketCompletedDate) would work here?

luizcdepaula
Creator III
Creator III

Try a simple mapping like below. Create the quarter table, and map it to the date. In visualization you simply concatenate quarter and year.

QuartersMap:
MAPPING LOAD
rowno() as Month,
'Q' & Ceil (rowno()/3) as Quarter
AUTOGENERATE (12);

,ApplyMap('QuartersMap', month(Date), Null()) as Quarter

I hope it helps.

Luiz