Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
but is there probably an other way to extract the MAX and MIN out of a set of variables? In the tMAP component for example?
if(input_row.date!=null){
//max date
if(context.maxDate==null){
context.maxDate= input_row.date;
}else{
if(context.maxDate.getTime()<input_row.date.getTime()){
context.maxDate=input_row.date;
}
}
//min date
if(context.minDate==null){
context.minDate= input_row.date;
}else{
if(context.minDate.getTime()>input_row.date.getTime()){
context.minDate=input_row.date;
}
}
}
output_row.date=input_row.date;
output_row.maxDate=context.maxDate;
output_row.minDate=context.minDate;
//you can aslo set the max/min date to global vars which will be used //later. eg:
globalMap.put("maxDate",context.maxDate);
globalMap.put("minDate",context.minDate);
Starting job forum7316 at 17:50 11/07/2009.
.--------+--------+--------.
| tLogRow_1 |
|=-------+--------+-------=|
|date |maxDate |minDate |
|=-------+--------+-------=|
|20090212|20090212|20090212|
|20090313|20090313|20090212|
|20081202|20090313|20081202|
|20081213|20090313|20081202|
'--------+--------+--------'
Job forum7316 ended at 17:50 11/07/2009.
//max date
if(context.maxDate==null){
context.maxDate= input_row.date;
}else{
if(context.maxDate.getTime()<input_row.date.getTime()){
context.maxDate=input_row.date; //here I set a value to context var.
}
}
//min date
if(context.minDate==null){
context.minDate= input_row.date;
}else{
if(context.minDate.getTime()>input_row.date.getTime()){
context.minDate=input_row.date; //here I set a value to context var
}
}
}