Avatar

Correct answer by
Level 1

Hello @Ramaswami, 

 

I do not see where you increment vars.iteration, you can do it after your 'data extraction file' with a javascript.

By doing with this workflow, you assume to have x files with just one line. x is the number of iteration.

 

May be, if you want just one file with x lines, I recommand to create a file and add lines for each sql request you need.

 

var array = ["Birthday_Dynata%Mar%2020" , "Birthday_Dynata%Jun%2020"];
... // your variables
var f = new File("c:/file.csv")
f.open("a")

for each (item in array)
{
vars.success = "select count(*) from NmsBroadLogRcp B1 JOIN NmsDelivery D2 ON (D2.iDeliveryId = B1.iDeliveryId) and "+
"D2.sLabel like '"+ vars.templateName +"' and (B1.tsEvent>='"+ vars.fromDate +"' and B1.tsEvent<='"+ vars.toDate +"')";

vars.succSent = sqlGetInt(vars.success) // success count of Mar emails for 1st iteration
f.writeln("dataTxt;" + vars.succSent + ";" + vars.fromDate )

}
f.close()

 

Best regards, 

Alexandre Planchot

View solution in original post