Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Date convertion

Hi,


I have a date format like MM/DD/YYYY,I would like to convert it to YYYY Q   format.

Thanks

Tags (1)
14 Replies
senpradip007
Valued Contributor III

Re: Date convertion

Try like:

=Year([Your Field]) & ' Q' & ceil(Month([Your Field])/3)

Re: Date convertion

Hi Rajesh,

Try like this:

Date(Ceil(datefield),'YYYY') &'Q' as newfiled

Not applicable

Re: Date convertion

I am not successed with above script.

ex:

Date:

8/8/2014(MM/DD/YYYY format)---i would like to convert it 2014 Q3??

any sugestions.

thanks

anbu1984
Honored Contributor III

Re: Date convertion

=SubField('8/8/2014','/',3) & ' Q' & Ceil(SubField('8/8/2014','/',1)/3)

MVP
MVP

Re: Date convertion

=Year(Date#('8/8/2014', 'MM/DD/YYYY'))&' Q'&ceil(Month(Date#('8/8/2014', 'MM/DD/YYYY'))/3)

You can replace the date here with your datefield.

Re: Date convertion

Hi Rajesh,

Try like this:

Date(Ceil(datefield),'YYYY') &'Q' &Ceil(SubField(datefield),'/',1)/3) as newfiled

this should work

Not applicable

Re: Date convertion

i didi not get expected output ,i got some thing like Q13953

 

Date(Ceil([Bookings Date (2)],'YYYY')) &'Q' &Ceil(SubField([Bookings Date (2)],'/',1)/3) as [Booking Quarter],

Thanks

Re: Date convertion

Hi,

Try this,

=Year(Date(DateField, 'MM/DD/YYYY'))&'  Q'&ceil(Month(Date(DateField, 'MM/DD/YYYY'))/3)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.

Re: Date convertion

Hi,

try like this:

Date(Ceil([Bookings Date (2)],'YYYY')) &'Q' & Date(Ceil([Bookings Date (2)]),'MM')/3 as [Booking Quarter]

Community Browser