Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
which function do i need to use to achieve this
jan
feb
mar as Q4 2015
apr
may
jun as Q1 2016
July
aug
sep as Q2 2016
oct
nov
dec as Q3 2016
and actual/calendar year is 2015
current my expression is this which is not good
'Q'&ceil(MONTH(DATE)/3) AS QUATERS,
year(DATE) as YEAR
thanks
naveen
'Q' & Ceil (RowNo()/3) as Quarter
R you getting year value as 2004, year(Date_Of_Review ) for 2004-01-15,
If yes then its correct,
else create date as date(date#(Date_Of_Review,'YYYY-MM-DD')) as Date,
Then all functions you can apply on this date
is this one line gona work
people over there is telling me that i am getting wrong o/p
i mean
2004-01-15 as 2003Q4
but it has to be 2004Q4
Hi Naveen ,
By using function described above , you can get the correct value......
I think you need to consider creating a Fiscal Year Calendar. or use the logic within the script to create like below may be
SET vFiscalYearStartMonth = 4;
LOAD FieldNames,
DATE_OF_REVIEW,
Dual('Q' & Ceil(Mod(Month(DATE_OF_REVIEW) - $(vFiscalYearStartMonth), 12)+1/3), Ceil(Mod(Month(DATE_OF_REVIEW) - $(vFiscalYearStartMonth), 12)+1/3)) as FiscalQuarter
FROM Source;
AFTER using the below code ,
SET vFiscalYearStartMonth = 4;
LET vStartDate = Num(YearStart(Today(), -1));
LET vEndDate = Num(YearEnd(Today()));
Dual('Q' & Ceil(Mod(Month(DATE_OF_REVIEW) - $(vFiscalYearStartMonth), 12)+1/3),
Ceil(Mod(Month(DATE_OF_REVIEW) - $(vFiscalYearStartMonth), 12)+1/3)) as QUATERS,
YearName(DATE_OF_REVIEW, 0, $(vFiscalYearStartMonth)) AS YEAR
i am getting this ,plz find attached file
still i am getting same ,1/15/2004 as 2003Q4
which as to be 2004Q4
I am going to test it out now and will get back with my findings
plz find my attached sample file