Thursday, January 17, 2013

[BI Apps] – Incorrect Quarter Ago Measures


In BI Apps, Quarter Ago measures are incorrect because for some days, the previous quarter ago wids are not populated correctly.

For example, 20110631 does not exist but 20110331 does exist. Hence this mapping should be done.

Either you change the pre-built mappings to populate the W_DAY_D or just use the update statements for some years in the post sql of the W_DAY_D mapping. Of course not the right solution. You can use this solution if you are running out of time, make sure to document it so it is taken or update command is extended as the years roll on



UPDATE W_DAY_D SET QUARTER_AGO_WID=20091129 WHERE ROW_WID=20100229;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20091130 WHERE ROW_WID=20100230; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20091131 WHERE ROW_WID=20100231;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20100131 WHERE ROW_WID=20100431;
UPDATE W_DAY_D SET QUARTER_AGO_WID=20100331 WHERE ROW_WID=20100631;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20100631 WHERE ROW_WID=20100931;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20100831 WHERE ROW_WID=20101131; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20101129 WHERE ROW_WID=20110229;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20101130 WHERE ROW_WID=20110230;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20101131 WHERE ROW_WID=20110231;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20110131 WHERE ROW_WID=20110431; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20110331 WHERE ROW_WID=20110631;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20110631 WHERE ROW_WID=20110931; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20110831 WHERE ROW_WID=20111131; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20111130 WHERE ROW_WID=20120230; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20111131 WHERE ROW_WID=20120231; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20120131 WHERE ROW_WID=20120431; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20120331 WHERE ROW_WID=20120631;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20120631 WHERE ROW_WID=20120931;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20120831 WHERE ROW_WID=20121131; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20121129 WHERE ROW_WID=20130229; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20121130 WHERE ROW_WID=20130230; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20121131 WHERE ROW_WID=20130231; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20130131 WHERE ROW_WID=20130431;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20130331 WHERE ROW_WID=20130631; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20130631 WHERE ROW_WID=20130931; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20130831 WHERE ROW_WID=20131131; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20131129 WHERE ROW_WID=20140229;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20131130 WHERE ROW_WID=20140230;
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20131131 WHERE ROW_WID=20140231; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20140131 WHERE ROW_WID=20140431; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20140331 WHERE ROW_WID=20140631; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20140631 WHERE ROW_WID=20140931; 
 UPDATE W_DAY_D SET QUARTER_AGO_WID=20140831 WHERE ROW_WID=20141131;