How do I define and use a ‘custom’ variable. I tried creating a Template Variable like so…

…but if I use the value in a Script Calculation like so…

…it doesn’t work. The Query Inspector shows that the literal variable text (i.e. $TotalThroughput) is inserted in the query, rather than the value I assigned to the variable (i.e. 18174).