Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Kohli
Creator II
Creator II

Hi team

I have created Quarter for a year.  Q1-JAN,FEB, MAR   Q2-APR MAY JUN    Q3-JUL AUG SEP  Q4-OCT NOV DEC.

BUT I WANT Q1 as APR, MAY, JUN

pls help me how can i change it.

10 Replies
Clever_Anjos
Employee
Employee

Could you show us how you´ve created your Quarter?

techvarun
Specialist II
Specialist II

Where you created these mapping in a File or in an INLINE load.

A sample will help here.

sergio0592
Specialist III
Specialist III

Try with :

quartername(Date_field, 0, 4)

its_anandrjs

Add new mapping table in your data model.

Ex:-

QrtMap:

Mapping LOAD

[

Month,Quarter

APR,Q1

MAY,Q1

JUN,Q1

JUL,Q2

AUG,Q2

SEP,Q2 

OCT,Q3

NOV,Q3

DEC,Q3

JAN,Q4

FEV,Q4

MAR,Q4

];

LOAD

ApplyMap('QrtMap',MonthField,Null()) as NewWuarter

from Location;

prma7799
Master III
Master III

Try like this at backend

  'Q' & alt(if(Month([Date])<4,4),if(Month([Date])<7,1),if(Month([Date])<10,2),3)  as Quarter

Kohli
Creator II
Creator II
Author

I HAVE create two varibles V1 as start date from 1-1-2001'  v2  end date 31-12-2010'

using dual (ceil(month/3)) like that way i have creatd, but my business year started from Apr_Mar not jan_Dec

Clever_Anjos
Employee
Employee

could you post your exact code?

I´m gonna change it for you

vikasdesai
Partner - Contributor III
Partner - Contributor III

Hello

Put Following Script In Your Backend-

Temp:

Load 

              min(Date) as minDate, 

              max(Date) as maxDate

          

Resident MainData; 

Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 

Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 

DROP Table Temp;

Master Calender:

Load *,

dual('Q'&ceil([Fiscal Month Num]/3),ceil([Fiscal Month Num]/3)) as FiscalQuarter;

Load

if (month(TempDate)<=3,month(TempDate)+(12-3), month(TempDate)-3) AS [Fiscal Month Num];

LOAD 

  $(varMinDate) + Iterno()-1 As Num, 

  Date($(varMinDate) + IterNo() - 1) as TempDate 

  AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate); 

Regards

Vikas

Clever_Anjos
Employee
Employee

Please try with

dual('Q'&ceil(Addmonths([Fiscal Month Num],3)/3),ceil(Addmonths([Fiscal Month Num],3)/3)) as FiscalQuarter;