informatica 9.1 latest project scenario and 2015 first page
Hi Folks,
I have a one table project_est_db,in this table two columns like s_no,DAY_DT like this data:
5 08-jan-2015
. ---------------
. ----------------
. ---------------
. ----------------
. ----------------
29 30-jan-2015
I have a one table project_est_db,in this table two columns like s_no,DAY_DT like this data:
S_NO Day_DT
1 04-jan-2015
2 05-jan-2015
3 06-jan-2015
4 07-jan-20155 08-jan-2015
. ---------------
. ----------------
. ---------------
. ----------------
. ----------------
29 30-jan-2015
This is actually dimentional table.this table use to all related dates,time_stamp realted.so that i am
face one scenario actually. that is ??
In same above table i want next 2 weeks data and previous 2 weeks data.I think confusee right ??
so data like this,
S_NO Day_DT Next_week1 Next_week2 Prev_week1 Prev_week2
1 04-jan-2015 20150104 20150111 20150103 20141227
2 05-jan-2015 20150105 ---------- 20150102 20141226
3 -------------- ----------- --------- -------------- -----------
4 -------------- ------------ ----------- 20141231 -----------
5 -------------- ------------- ----------- ------------ ----------
6 -------------- ------------- ----------- ----------- ------------
7 10-jan-2015 20150110 20150116 20141228 20141221
You can use this queries:
1.For Next_week1
UPDATE project_est_db D1 SET Next_week1=
(SELECT to_number(to_char(D.day_dt+(7*1),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT);
2.For Next_week2
UPDATE project_est_db D1 SET Next_week2=
(SELECT to_number(to_char(D.day_dt+(7*2),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT);
3.For Prev_week1
UPDATE project_est_db D1 SET Prev_week1=
(SELECT to_number(to_char(D.day_dt-(7*1),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT)
4..For Prev_week1
UPDATE project_est_db D1 SET Prev_week2=
(SELECT to_number(to_char(D.day_dt-(7*2),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT)
so data like this,
S_NO Day_DT Next_week1 Next_week2 Prev_week1 Prev_week2
1 04-jan-2015 20150104 20150111 20150103 20141227
2 05-jan-2015 20150105 ---------- 20150102 20141226
3 -------------- ----------- --------- -------------- -----------
4 -------------- ------------ ----------- 20141231 -----------
5 -------------- ------------- ----------- ------------ ----------
6 -------------- ------------- ----------- ----------- ------------
7 10-jan-2015 20150110 20150116 20141228 20141221
You can use this queries:
1.For Next_week1
UPDATE project_est_db D1 SET Next_week1=
(SELECT to_number(to_char(D.day_dt+(7*1),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT);
2.For Next_week2
UPDATE project_est_db D1 SET Next_week2=
(SELECT to_number(to_char(D.day_dt+(7*2),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT);
3.For Prev_week1
UPDATE project_est_db D1 SET Prev_week1=
(SELECT to_number(to_char(D.day_dt-(7*1),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT)
4..For Prev_week1
UPDATE project_est_db D1 SET Prev_week2=
(SELECT to_number(to_char(D.day_dt-(7*2),'YYYYMMDD')) FROM project_est_db D WHERE D1.DAY_DT=D.DAY_DT)