Filters in native sql queries used in pivot table-filter?

Hi!
I would like a native sql query being visualized in a pivot table. I read that this is not possible directly, so i need to save the sql as a query and use that query in the ui editor to enable pivot tables.
The problem here is, that the sql query has a filter, with a variable like this:
... FROM revinfo [[WHERE revtstmp <= {{revtstmp}}]]
And this filter isn't exported to the ui editor.
On the other hand: In the editor i can't set the (same) filter, as it is removed when saving as a query (to open for the pivot table) and then it would be a filter in the inner sql query. So i can't address that filter in the ui editor.
Is there any solution for that problem? Maybe i can solve this using a view or something like this?

Hi there,

Since you're using the query builder on top of a SQL question, you can't set the filters on the SQL question through it. Your SQL question should return all the unaggregated rows for the pivot table, and then you would need to filter it on the Query Builder (the "outer" question) and summarize it.
The field that you need to filter on should be exposed as a column in the SQL question so you can filter it from the outer question.

If that isn't possible, could you give us a bit more context on what the SQL question is filtering on?