A Table Variable is just a saved string of characters. Even if your value of QQ would have worked, your IF statement could never be true.
if ( dt:TT == 51, show("success"), show("didn't quite work"));
dt:TT can never have the value of 51. All table variables end up as character strings, so the IF statement was ever going to work, it would have to be written as:
if ( dt:TT == "51", show("success"), show("didn't quite work"));
Here is the documentation from the Scripting Guide
Table Variables
Table variables are for storing a single text string value, such as “Notes”. To understand how
variables work, first get its existing value by sending a Get Table Variable message:
dt = Open( "$SAMPLE_DATA/Solubility.jmp" );
dt << Get Table Variable( "Notes" );
"Chemical compounds were measured for solubility in different solvents. This
table shows the log of the partition coefficient (logP) of 72 organic
solutes in 6 aqueous/nonpolar systems."
Now change the existing value of the string using Set Table Variable and then use Get
Table Variable again to check that the string has been updated:
dt << Set Table Variable( "Notes", "Solubility of chemical compounds" );
dt << Get Table Variable( "Notes" );
"Solubility of chemical compounds"
The following example adds two new table variables to a data table:
dt = Open( "$DOCUMENTS/Big Class.jmp" );
myvar = "This is my version of the JMP Big Class sample data.";
dt << Set Table Variable( "key1", myvar );
dt << Set Table Variable( "key2", myvar );
Notice that setting the value creates a new variable only if one by the given name does not
already exist. If you add two table variables with the same name, only one variable is created.
You could possibly do what you want using a Table Script, but you would have to first set the table variable QQ and then run the table script that would update TT
Jim