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).
https://XXXXXXXX:38888/arc/apps/appgroup/2233?param.rpt=<>

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,
Ganesh