Can anyone see why my SWQL variable is not working for my WPM email alerts?

Hello Everyone!

I wanted to know why my swql is not working even though I tested the code:

${N=SWQL;M=SELECT ROUND(LastDuration / 1000.0, 1) AS DurationInSeconds
FROM Orion.SEUM.TransactionSteps
WHERE TransactionStepId = ${N=SwisEntity;M=TransactionStepId}

Original code:

${N=SWQL;M=SELECT ROUND(([LastDuration]/1000.0),1) AS Seconds FROM Orion.SEUM.Transactions WHERE TransactionId =${N=SwisEntity;M=TransactionId} }

thank you!