I'm confused. Query A and B are exactly the same...so it's impossible to tell what is wrong with query B. Can you please share some screenshots of the data pane and your filters, etc. so we can see what you've done?
Yeah it will return different result sets because
In this example, you've used the LEFT JOIN clause to query data from the A and B tables. The query returns keys and its detail, if any, for the year 2012/13.
However, if you move the condition from the WHERE clause to the ON clause. It will have a different meaning. In this case, the query returns all keys but only for years 2012/13 will have detail associated with it.
Notice that for INNER JOIN clause, the condition in the ON clause is equivalent to the condition in the WHERE clause.
Hope this help.
Is there any way to implement the Query A setup in Tableau data model? Basically filter restricted to child table (table B).
Why don't you create a system view out of Query A in your back end database. Then connect that view in tableau for your analysis.
If you wants to implement it in tableau then first join both source (A and B) with [Key] field. Then put a data source filter on [Year] field from source B and select only 2012 and 2013. I believe in that you way you can have your set of data which your query A is resulting.
How to join and put data source filter you may follow these knowledge base articles.
Let us know if this help.