on 10-26-2010 7:19 PM
Hi ,
I need to convert day of the year into date format .
For example 60 day of the year convert into 01/03 of the year if year is not leap year. if its is leap year 29/02 format.
if any date function like dateadd(date,no of days ) available in BODI
08060 i need to conver into 29/02/2008
07060 i need to conver into 01/03/2007.
for this one (01/01/2008)+60 then we will get the date for that year.
how can i implement this in business objects data integrator .
please let me know how to solve this problem .
Thanks&Regards,
Ramana.
Hi ,
Using Custom function i solved this issue .
Here I am giving the custom function what i have used .
$V_Julian_Date = $P_Julian_Date;
$V_Julian_Date_Year = substr($V_Julian_Date,1,2);
$V_Julian_Date_Date = substr($V_Julian_Date,3,3);
$V_Current_Year = year(sysdate());
$V_Current_Year = substr($V_Current_Year,3,2);
if (cast($V_Julian_Date_Year,'int') <= cast($V_Current_Year,'int'))
begin
$V_Julian_Date_Year= '20'||$V_Julian_Date_Year;
end
else
begin
$V_Julian_Date_Year= '19'||$V_Julian_Date_Year;
end
$V_Gregorian_Date= to_date('01'||'01'||$V_Julian_Date_Year,'DDMMYYYY')+cast($V_Julian_Date_Date,'int')-1;
Return($V_Gregorian_Date);
Thanks&Regards,
Ramana.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Definetely there is not standard function available for this activity.
You will have to write some sql functions yourself for this to implement it in Data integrator.
I think it will be similar to an ABAP code for the same in sql as well. Let me know if you got the solution or need more inputs on this.
Regards,
Den
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Den,
I got the solution . just once check my script for converting YYDDD format to DDMMYYYY format and Hijri date to Gregorian date .
$Hijri_Date = '16/04/1428';
$Julian_Date ='57060';
$Julian_Date_Year = substr($Julian_Date,1,2);
$Julian_Date_Date = substr($Julian_Date,3,3);
$Current_Year = year(sysdate());
$Current_Year = substr($Current_Year,3,2);
if (cast($Julian_Date_Year,'int') <= cast($Current_Year,'int'))
begin
$Julian_Date_Year = '20'||$Julian_Date_Year;
end
else
begin
$Julian_Date_Year = '19'||$Julian_Date_Year;
end
$Gregorian_Date1 = to_date('01'||'01'||$Julian_Date_Year,'DDMMYYYY')+cast($Julian_Date_Date,'int')-1;
$Gregorian_Date = sql('DS_REPO','SELECT CONVERT(DATE,{$Hijri_Date},131)');
$Gregorian_Date = $Gregorian_Date+1;
print($Gregorian_Date);
print($Gregorian_Date1);
Waiting for your comments on this code.
Thanks&Regards,
Ramana.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.