Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Fiscal Calendar Problem

Hi,

we have to follow calendar April-March and We have a field 'OrderDate', Based on this field how can i derive the year?

for eg:

For the period April-01-2014 to March-31-2015 we need to show year as 2014.

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

It will be worth calculating some new fiscal period fields in your load script.

Here are a few examples that take a field called 'Date' and calculate a FiscalYear,FiscalMonthNumber,FiscalYearMonth etc...

LOAD

     Date,

     if( Month(Date)>=4, Year(Date), Year(Date) -1) as FiscalYear,

     if( Month(Date)>=4, Month(Date)-3,Month(Date)+9) as FiscalMonthNumber,

     if( Month(Date)>=4, Year(Date), Year(Date) -1) & ' - ' & if( Month(Date)>=4, Month(Date)-3,Month(Date)+9) as FiscalYearMonth,

     Year(Date) & ' - ' & Month(Date) as CalendarYearMonth

   

FROM

<source>;

here is the sample app for you to look at .

View solution in original post

3 Replies
JonnyPoole
Former Employee
Former Employee

It will be worth calculating some new fiscal period fields in your load script.

Here are a few examples that take a field called 'Date' and calculate a FiscalYear,FiscalMonthNumber,FiscalYearMonth etc...

LOAD

     Date,

     if( Month(Date)>=4, Year(Date), Year(Date) -1) as FiscalYear,

     if( Month(Date)>=4, Month(Date)-3,Month(Date)+9) as FiscalMonthNumber,

     if( Month(Date)>=4, Year(Date), Year(Date) -1) & ' - ' & if( Month(Date)>=4, Month(Date)-3,Month(Date)+9) as FiscalYearMonth,

     Year(Date) & ' - ' & Month(Date) as CalendarYearMonth

   

FROM

<source>;

here is the sample app for you to look at .

Anonymous
Not applicable
Author

Thanks Jonathan,

It's Working