Custom SQL with parameter from URL

Dear @taddwood/@shaun ,

Please help me with below scenario.
I was passing parameter value through url to launch into another dashboard and need to pass the parameter to Custom SQL.

For example, in below url ‘rpt’ is the parameter value which I was passing to another dashboard(2233).

Once after that then I need input the ‘rpt’ parameter value in Custom SQL.

Select count(*) from tablename
Where portfolio = ‘<>’ – this way is not working.

Thank you,