Filter report using dynamic filter using function not working

Filter report using dynamic filter using function not working

Hi - I am trying to dynamically filter a report as follows:



when I save the filter it looks like this:



However when I run the report it is not returning results as I expect.

I have tested the function.  If I copy and paste the output of the function and use that as a filter it does show the results I expect.  It seems as if Creator is not recognising this as a dynamic function. 

Can anyone explain what I'm doing wrong?  Have I got the syntax wrong?

Thanks!