Populating Time Dimension with SQL script - Teradata -
folks,
i trying populate time dimension table sql script.
something below expected output.
& 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
Post a Comment