Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
rathnam_qv
Creator
Creator

Creating Quarter


Hi all,

i hv the following number format from that i have to calculate Quartes..

how to do that can any one help me...

Thanks in advance

Smiley

7 Replies
Anonymous
Not applicable

Are these no. Representing date?

If yes

Then first You can convert them in Date Format by using Date(Fieldname,'DD/MM/YYYY') and then make quarter using the month in it.

Gysbert_Wassenaar

It looks like your ABC field contains numeric dates. That's good. ceil(month(ABC)/3) will then create the quarternumbers. It's best to create a Quarters field in the script. Below is an example (so don't copy it blindly into your script):

Load

    ABC,

    Month(ABC) as Month,

    dual('Q' & ceil(month(ABC)/3), ceil(month(ABC)/3)) as Quarter

    Year(ABC) as Year

From ...sourcedata...;

By using the dual function the Quarter field will have a numeric value (1 to 4) and a display value Q1 to Q4.


talk is cheap, supply exceeds demand
vikasmahajan

'Q' & alt(if(Month(TempDate)<4,4),if(Month(TempDate)<7,1),if(Month(TempDate)<10,2),3) AS Quarter,

take that date with tempdate and give above formula for Qtr

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
mdmukramali
Specialist III
Specialist III

Dear,

kindly find the attachment.

Thanks,

Mukram.

CELAMBARASAN
Partner - Champion
Partner - Champion

Try with

'Q' & Ceil(Month(DateField) / 3) AS QuarterFieldName

polisetti
Creator II
Creator II

convert them in Date Format by using Date(Fieldname,'DD/MM/YYYY')

And then

rowno() as Month,

'Q' & Ceil (rowno()/3) as Quarter;

salto
Specialist II
Specialist II

Hi,

Dual('Q'&Num(Ceil(Num(Month(Date))/3)),

Num(Ceil(NUM(Month(Date))/3),00))                     as [Quarter],

Year(Date)&Dual('Q'&Num(Ceil(Num(Month(Date))/3)),

Num(Ceil(NUM(Month(Date))/3),00))                     as [Year Quarter] ;

Do work for me in all my documents.

Regards!