I have been trying to query data from a table that exists only as a Table variable in my code. But that seems to return nothing.
Example:
I have a global "OfflineOrders" table and I query it to get a subset of the table. If I then want to further query against that result table I get nothing.
Table allorders = Table("OfflineOrders"); Table OrdersList = Table.query("SELECT * FROM $1 WHERE [SimSku] = 43 OR [SimSku] = 20 OR [SimSku] = 7", allorders); tab.cloneTo(Table("temptable")); Table tab = Table.query("SELECT * FROM $1 WHERE [SimSku] = 20", OrdersList); tab.cloneTo(Table("temptable_2"));
temptable:
temptable2:
If I add a WHERE clause to my second SQL statement if fail all-together and returns an error (Obviously because it cant find any of the columns I am using in the WHERE clause).
I have discovered that if I create a new node and use the CloneTo method to clone my first result to a node and the query that node instead, it seems to work, but that is a rather bulky and cpu consuming method to be able to query results iteratively.
Is this a bug or working as designed?