You could use the same code and just return the "tmpTable3" (RETURN tmpTable3) and use that as a Table formula. However, it is not dynamic. 😞
Maybe one day we will get a Table visualization that you can tie a dynamic table to, that would be really cool. I don't think that exists as a custom visual that I have found, but might be worth checking into. Then you could just do an export.
I did solve this once so that you could generate a dynamic table visualization from the source table. But it used an user input table and some filtering. If I get a chance I'll try to dig it up as an example. Problem was that it solved being able to easily export but wasn't nearly as nice of a user interface and took some setup.