Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

Create Rows in JavaScript

$
0
0
Hello! i'm new here!
I dont know why my code dont work:

Code:

var fi = Fecha_Inicio;
while
(fi<=Fecha_Termino)
{
  newRow = createRowCopy(getOutputRowMeta().size());
  var rowIndex = getInputRowMeta().size();
  newRow[rowIndex++] = fi;
  newRow[rowIndex++] = "N";
  putRow(newRow);
  dateAdd(fi,"d",1); 
}
var Fecha = "";
var ignore = "Y";

I'm triying to create multiple rows from a range of two dates.

Example:

Input Data:

ID Fecha_Inicio Fecha_Termino
1 10/12/2013 12/12/2013


->The date (Fecha_Inicio and Fecha_Termino) are in dd/mm/yyyy

Output Data:

ID Fecha_Inicio Fecha_Termino Fecha
1 10/12/2013 12/12/2013 10/12/2013
1 10/12/2013 12/12/2013 11/12/2013
1 10/12/2013 12/12/2013 12/12/2013


What is wrong with my code? How Can I do that?

Thanks!
Greetings!

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>