All Months between Start date and add_months(start_date,12)
Hi everyone,hope eveyone doing great! I am new to this forum and i would like to learn new things and suggessions.
I am getting a problem while resolving a scenario to load the dates and corresponding slaries.
I have employee table and Time_Dim tables in my DW
Employee table has columns like Emp_id,emp_start_month,emp_end_month, emp_type and annual_sal
Time_Dim table has columns like f_date,f_month_number,f_month_name like that
Now my scenario is
Based on Emp_type and Emp_start_date i want to calcualte emp_salary for each month.
I want to show each emp salary for every month.
If EMP_TYPE = 'MANAGER' then (total_sal/add_months(emp_start_dt,12))
i want to do it like above, but it has to display for all the months like jan, feb,mar
My hard time is tp define a filed that shows each month name and number in a Cursor.
I attached a test case that will show the actual data and desired data(how i want to display).