Of course. Below is my solution:
I put all the TFA as a temporary list into the main. Then Make the output result into data table. Since I just want to save column for the first TFA that appeared in the table, I use that TFA number to search back in the temporary list i created in the main and save that into save column.
main = {};
obj = dt << Time Series(
X( :Time ),
Y( :Shipment ),
Input List( :Capacity ),
Number of Autocorrelation Lags( 20 ),
Number of Forecast Periods( 11 ),
Input Series( :Capacity, Number of Autocorrelation Lags( 20 ), Number of Forecast Periods( 11 ) )
);
temp = obj << Transfer Function(
Order( 0, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 1, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 1, 1, 0 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 0, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 0, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 0, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 0 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 1, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 0, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 1, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 0 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 0 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 1, 1, 2 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 2, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 0, 1, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 1, 2 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 2, 0, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 0, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 2, 0, 0 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 0, 2 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 1, 0, 0 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
temp = obj << Transfer Function(
Order( 2, 1, 1 ),
Seasonal( 0, 0, 0, 12 ),
:Capacity( Order( 0, 0, 1 ), Seasonal( 0, 0, 0, 12 ), Lag( 0 ) ),
Number of Forecast Periods( 11 ),
);
Insert Into( main, temp );
datatable = Report( obj )[Table Box( 5 )] << make into data table;
datatable << Set Name( "table1" );
datatable << New Column( "Model2",
Numeric,
Continuous,
formula( Num( Regex( :Model, "\D", "", GLOBALREPLACE ) ) )
);
maxvalue = datatable[1, 11];
dt2 = main[maxvalue] << Save Columns;
dt2 << Set Name( "Result1" );
Column( dt2, 4 ) << Set Name( "Predicted_Shipment_1" );
... View more