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

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
RAJ6
Contributor III
Contributor III

Whether it is possible to create calendar table using tRowGenerator

Hi Talend Folks,
                       I need to create below structure calendar table using tRowGenerator component. 
Whether it is possible or not?
 
Calendar Table :
Date Key (8 digit Numeric)
Cal Date (Date Format) (eg. 8JUNE2017)
Year (eg 2017)
Fiscal Year (eg.2017)
Month (eg. June)
Cal Month Num (eg. 6)
Cal Week Start Date (eg. 5JUNE2017)
Cal Week End Date (eg. 10JUNE2017)
Week (1 to 52) (eg. W1)
Cal Week Num (within Month) (eg. W1- W5 and resets to W1 with start for new month)
Day Name (eg.   Thursday)
QTR Num (eg. Q2)
QTR Start Date (eg. 01APR2017)
QTR End Date (eg.30JUN2017)
Labels (2)
5 Replies
Anonymous
Not applicable

Hi,

 

You can use a tRowGenerator to generate a list of dates of your choosing, then use a tMap to create all the derived fields from that date. 

 

0683p000009Lvuh.png

 

I'm using context to define the start date (Date type) and number of days to generate.  Then generating a sequence and adding that to the date for each generated row. 

 

Then in your tMap, just calculate the rest as needed: 

0683p000009LwCK.png

RAJ6
Contributor III
Contributor III
Author

 Thank you @lli

I appreciate for your response.I also completed 8 columns. completed columns are given in screenshots.

0683p000009Lw8P.png

could please tell me?. How to create below column also?
1) Fiscal Year (2016-2017)
2) Cal Week Start Date (eg. 5JUNE2017)
3) Cal Week End Date (eg. 10JUNE2017)
4) Cal Week Num (within Month) (eg. W1- W5 and resets to W1 with start for new month)
5) Quarter Start Date (eg. 01APR2017)
6) Quarter End Date (eg.30JUN2017)
7) Fiscal Month
😎 Fiscal QTR

cterenzi
Specialist
Specialist

You'll need to do date math. It may be easiest to create some routines to do the calculations. Stackoverflow has articles on how to calculate various dates based on a Java date.
Anonymous
Not applicable

getting the error "cannot convert Date to String"

Anonymous
Not applicable

@verma_gauri, check the data type of column, the data type should match the data type of return value of the function.