Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

calendar yr to indian financial yr and Quarter

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

26 Replies
Anonymous
Not applicable

'Q' & Ceil (RowNo()/3) as Quarter

Anonymous
Not applicable

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

kunkumnaveen
Specialist
Specialist
Author

is this one line gona work

kunkumnaveen
Specialist
Specialist
Author

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

Anonymous
Not applicable

Hi Naveen ,

By using function described above , you can get the correct value......

sunny_talwar

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;

kunkumnaveen
Specialist
Specialist
Author

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

kunkumnaveen
Specialist
Specialist
Author

still i am getting same ,1/15/2004 as 2003Q4

which as to be 2004Q4

sunny_talwar

I am going to test it out now and will get back with my findings

kunkumnaveen
Specialist
Specialist
Author

plz find my attached sample file