Populating Time Dimension with SQL script - Teradata -


folks,

i trying populate time dimension table sql script.

something below expected output.

enter image description here

& below partial sql script not giving correct output.

sel   calendar_date date_,       rank( ) on ( order calendar_date) date_key,       rank( ) on ( order extract(month calendar_date)) month_key  sys_calendar.calendar  order calendar_date 

could please me find issue in code ?

as code stucked @ month_key population, not done remaing code ...

change rank() on (order extract(month calendar_date)) month_key use dense_rank looks rows month in year should have same key.

sel   calendar_date date_,   rank() on (order calendar_date) date_key,   dense_rank() on (order extract(year calendar_date),extract(month calendar_date)) month_key  sys_calendar.calendar  order calendar_date 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -