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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Generating Date Dimensions

I have a version of some script to generate a calendar table to include such values like the calendar year etc... This run based on peeking at a dataset and capturing the the min and max dates.

However I am not certain how to generate the following, and was hoping someone might have a solution:

  • Calendar Month in the format "1" or "2" etc.
  • Fiscal Month in the format "1" or "2" etc.
  • Calendar Qtr in the format "Q1" or "Q2" etc.
  • Fiscal Qtr in the format "Q1" or "Q2" etc.
  • Fiscal Yr in the format "00/01" or "01/02" etc.

If anyone can point me in the right direction it would be much appreciated.

Thanks

Matt

1 Reply
Not applicable
Author

Hi Matt,

Please go through the Date_Time Functions in the help. Once you have a date, formatting could be done using the date() funtion. For the Month/Quarter numbers, there are functions, and You could also use a simple inline table like:

Load * Inline [

Month, Quarter, MonthNo,QuarterNo, FiscalMonthNo,FiscalQuarterNo

Jan, Q1,1,1,10,4 // In case fiscal year starts in April, Jan will be 10th month, falling in 4th quarter

.

.

.

.