on 08-23-2013 3:20 PM
Hi
I need some help on the writing java udf in PI . or it an be done in graphical mapping .I need to map the latest line item schedule delivery date from idoc source field to target expected completion date
for example here is the source and target
Source Target
E1EDP2 0.99999 Controldetails
EDATU --------->- completiondate 1.1
EDATU 08/20/2013
EDATU 09/20/2013
EDATU 10/05-2013 ------> completiondate
EDATu 09/02/2013
Thanks for your help
MK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If u wish to have a UDF for this then add import instructions as shown below & have a UDF with all values of queue:
See it is working:
Here is the code:
try
{
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date Stt = dateFormat.parse("00/00/0000");
for(int i =0;i<var1.length;i++)
{
Date TaskDate = dateFormat.parse(var1[i]);
if(TaskDate.after(Stt))
Stt = TaskDate;
}
DateFormat df3 = new SimpleDateFormat("dd/MM/yyyy");
result.addValue(df3.format(Stt));
}
catch(ParseException p)
{
result.addValue(p.toString());
}
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adarsh has given a good solution. Adding to that, you should convert the date to format YYYYMMDD a and after sort and collapse context, convert it back to the date format you want.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You need to have a trick over here. As you are having date which can be 09/20/2012 & say 01/04/2013. You should first transform this date format into YYYY/MM/dd. After that you need to do sorting as shown below, followed by another Date transformation to have the date in original format:
As you are now sorting after transforming into format yyyy/mm/dd, you will always get the latest date, even if the years are different.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.