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

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

Add date to data in the script


HI,

I need to analyze the model by year quarters and months.

Sales table between 2007 - 2010 and the budget table should be the same every year.

Can someone show me how to add it to the script?

2 Replies
Not applicable
Author

You can create the Year field by : Year(DateField) AS Year

and Quarter by: Q & Ceil(Month(DateField)/3) AS Quarter

Not applicable
Author

Or You can create the Master Calender Table and connected the Calender Table through your Date field.

CALENDAR:

LOAD DATEFIELD ,

          Year(DATEFIELD) AS YEAR,

          Month(DATEFIELD) AS MONTH

          'Q' & Ceil(Month(DATEFIELD)/3) AS QUARTER,

          Week(DATEFIELD) AS WEEK

;

LOAD DISTINCT DATEFIELD

Resident From SALES_TABLE;

You can any other calender fields to CALENDAR table if you need.