From what I gather, that isn't possible. First off, a simpler solution: <a href="https://pastebin.com/raw/nPNBNAS2" rel="nofollow">https://pastebin.com/raw/nPNBNAS2</a> Now if you really wanted to just reuse the queried value, you should know @{attributes} are converted directly into their relevant attribute entries before anything else happens, so if you try running a query on a portion of an attribute name you'll just break the attribute call entirely. In order to get @{?{Stat}} to parse how you want you'll need to do some weird stuff and send it to an API command button, like so: <a href="https://pastebin.com/raw/iPekYY00" rel="nofollow">https://pastebin.com/raw/iPekYY00</a> Have to escape the @ as &#64; in the first macro so it doesn't try to read it as an attribute yet, letting it get converted to a real @ on the API button that will reference the stat in question.