I cannot see where you have defined query result. Try the syntax in the attached script.
Group = Open("C:\Temp\Group$.jmpquery", Private );
Target = Open("C:\Temp\Target$.jmpquery", Private );
dtGroup = Group << Run Background(
On Run Complete(
New Column( "ExGroup",
Numeric,
"Ordinal",
Formula( :Data ) // this assumes there is a column name :Data in your query
);
)
);
dtTarget = Target << Run Background(
On Run Complete(
New Column( "ExTarget",
Numeric,
"Ordinal",
Formula( :Data ) // this assumes there is a column name :Data in your query
);
)
);
Here is a similar example, created and tested for JMP sample data Big Class.jmp.
Test = Open("C:\Temp\test.jmpquery",private);
dtTest = Test << Run Background(
OnRunComplete(
New Column( "ExTest",
Numeric,
"Ordinal",
Formula( :age ) // this assumes there is a column name :Data in your query
);
)
);