There are many ways to do this especially with scripting.
The example below should work (Might be a good idea to split the formula into smaller parts and take a look into Scripting Guide to understand what is going on (especially Loc() function)):
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(20),
Compress File When Saved(1),
New Column("Month",
Character,
"Nominal",
Set Values(
{"Jan", "Jan", "Jan", "Jan", "Jan", "Feb", "Feb", "Feb", "Feb", "Feb",
"Mar", "Mar", "Mar", "Mar", "Mar", "Apr", "Apr", "Apr", "Apr", "Apr"}
)
),
New Column("Condition",
Character,
"Nominal",
Set Values(
{"A", "A", "A", "B", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A",
"A", "B", "B", "A", "A", "A"}
)
)
);
dt << New Column("Result", Character, Nominal,
<< Formula(
If(Row() == 1,
monVals = :Month << Get As Matrix;
condVals = :Condition << Get As Matrix;
);
curMonthVals = Loc(monVals, :Month);
curCond = Loc(condVals[curMonthVals], "B");
If(N Items(curCond),
"Bad",
"Good"
);
)
);
I also attached example datatable with the formula included.
-Jarmo