Thank you. I am using 5.5 R2.22 - I updated my code before posting on this forum.
You made me curious, so I just tested the following, and it worked:
{%if (ToInt(currentdocument.nodeid, "") == "0") { "" } else { "Node Alias = " + currentdocument.nodealias }%}
But then I tested the following, and it does not work:
{%if (ToInt(testvar, "") == "0") { "" } else { "Test Var = " + testvar }%}
So it appears to be a bug on the query string macro. Can you confirm?