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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Creating Year Quarter

Hi All,

I had executed the below mentioned script for Creating Yearly Quarter. IF u load this script it will work fine the thing is for me Quater one Strat's from APR-JUN but in the below mentioned script it is taking Q1 as JAN-MAR how to solve this issue.

[Calendar]:

LOAD *

,dual('Q' & "Quarter Only" & ' ' & "Year Only",QuarterStart("Date")) as "Quarter"

;

LOAD *

,ceil("Month Only"/3) as "Quarter Only"

;

LOAD *

,date(monthstart("Date"),'MMM YYYY') as "Month"

,date(yearstart("Date"),'YYYY') as "Year"

,month("Date") as "Month Only"

,year("Date") as "Year Only"

;

LOAD date(today()  - recno()) as Date

AUTOGENERATE 365

;

Labels (1)
1 Reply
tresB
Champion III
Champion III

Try like:

FiscalCalendar:

Load Dual(fYear-1 &'/'& fYear, fYear) as FYear,          // Dual fiscal year
         Dual([Calendar Month], fMonth) as FMonth,           // Dual fiscal month
         Dual(fYear&'-'&'Q'&Ceil(fMonth/3), fYear*100+Ceil(fMonth/3)) as FQuarter,  // Dual quarter
         'Q'&Ceil(fMonth/3) as fQuarter,
          *;
Load [Calendar Year] + If([Calendar Month]>=$(vFM), 1, 0) as fYear
         Mod([Calendar Month]-$(vFM), 12)+1        as fMonth,          // Numeric fiscal month