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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
rcorcoran
Creator
Creator

Make quarter date from script attached

Hi below is the part of the script where I have made a date YearMonth from ReferredMM and ReferredYYYY.  I also need to make a quarter date field which I was trying below but not getting very far with. 

Any help would be greatly appreciated

FACTS:
LOAD  ActualValue,
ReferredMM,
ReferredYYYY,
MonthName(Date(makedate(ReferredYYYY,ReferredMM))) as YearMonth,
// 'Q' &Ceil(MonthName(Date(makedate(ReferredYYYY,(ReferredMM/3))))) as Quarter,
 



1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

Please try

='Q' & Ceil(Month(MakeDate(ReferredYYYY, ReferredMM, 1))/3)

hth

Sasi

View solution in original post

8 Replies
sunny_talwar

Try this for quarter:

'Q' & Ceil(Month(MakeDate(RefferedYYYY, ReferredMM, 1))/3) as Quarter


Update: Just realized that I missed a parenthesis

rcorcoran
Creator
Creator
Author

Hi Sunny T

Thanks for answering but it didn't work maybe because ReferredMM and ReferredYYYY are not date fields?

Thanks

sunny_talwar

Can you share the data within those two fields?

rcorcoran
Creator
Creator
Author

Yes see above where I have made the month and year into amalgamated date

jonathandienst
Partner - Champion III
Partner - Champion III

Assuming ReferredMM is a text month:

     Ceil(Month(Date#(ReferredYYYY & Left(ReferredMM, 3), 'YYYYMMM')) / 3) As Quarter

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sasiparupudi1
Master III
Master III

Please try

='Q' & Ceil(Month(MakeDate(ReferredYYYY, ReferredMM, 1))/3)

hth

Sasi

rcorcoran
Creator
Creator
Author

Thank you so much this has worked perfectly.

Rhona

rcorcoran
Creator
Creator
Author

Thanks Sunny also right.  Thanks for your help