Hi
I can't seem to get my data to write to out2 in the transform node. I've mocked up this simple example below to recreate the problem.
Input Data below (that is connected to a Transform node)
InputFileName, OutputLocation,TradeId, LEI, TradeDate, Notional, BuySellFlag, TotalQuantity, Price_SRC, Price_TGT, Output1, Output2, Output3
PTS1,"FIRST", 001, ,22-01-2021, 100, B,4,101.4555,101.5,,,
PTS1,"FIRST", 002,ABC,29-04-2021,3, X,,5,102.111,102.111,,
PTS1,"SECOND",003,DEF,29-04-2021,5, X,,6,103.678,103.69,,
PTS1,"SECOND", 004,XYZ,22-01-2021, 200, B,7,104,104.56,,,
Inside the Transform node I have this code
ConfigureFields:
out1 += in1
out2 += in1
ProcessRecords:
#Define an OutputData Function to output the data depending on the condition
def OutputData(OutputFlag, OutHandle):
if OutputFlag == "FIRST":
out1 = OutHandle
out1 +=in1
node.write(0,out1)
elif OutputFlag == "SECOND":
out2 = OutHandle
out2 +=in1
node.write(0,out2)
if in1.OutputLocation == "FIRST":
OutputData("FIRST", out1)
else:
OutputData("SECOND", out2)
After the transform runs all are written to out1 and none are written to out2.
Please can you advise where I am going wrong here? why did none of them get written to out2?
much appreciated!
Scott