I mistakenly copied wrong code in my question.Below is the code I wrote for if/else implementation but column CAT3 only has zeros.Is there an issue with the placement of else statement.
To reiterate I'm trying to bucket this into 2 categories,whatever values do not belong to CAT1/2 need to be bucketed as CAT3.
cdt = open("temp\Rawdata.csv");
cdt = Current Data Table();
sum_lst2 = {};
sum_lst3 = {};
sum_lst4 = {};
col_lst2 = cdt << get column names( Numeric );
For( i = 1, i <= N Items( col_lst2 ), i++,
colname = Column( col_lst2[i] ) << get name;
If(
Contains(
{"SS008", "SS009", "SS010", "SS015", "SS053", "FS9429", "FS9792", "FS9906", "FS9908", "FS1302", "FS1305", "FS1308", "FS1360", "FS1373",
"FS2744", "FS4621", "FS4625", "FS4630", "FS4640", "FS4681", "FS4830"},
colname
) | (colname >= "FS2900" & colname <= "FS2950") | (colname >= "FS3400" & colname <= "FS3450"),
Insert Into( sum_lst2, col_lst2[i] ), ///CAT1//
If( Contains( {"SS098", "SS090"}, colname ) | (colname >= "FS9700" & colname <= "FS9791") | (colname >= "FS9793" & colname <= "FS9799"),
Insert Into( sum_lst4, col_lst2[i] ), //CAT2//
),
Insert Into( sum_lst3, col_lst2[i] )///CAT3
)
);
Eval( Eval Expr( cdt << New Column( "CAT1", formula( Sum( Expr( sum_lst2 ) ) ) ) ) );
Eval( Eval Expr( cdt << New Column( "CAT3", formula( Sum( Expr( sum_lst3 ) ) ) ) ) );
Eval( Eval Expr( cdt << New Column( "CAT2", formula( Sum( Expr( sum_lst4 ) ) ) ) ) );