What database are you connecting to?
Also, are you not able to use exact query you posted as Custom SQL?
I am connecting to SQL Server 2008.
And yes, I can do that, but that does defeat the self service concept. Most users will not be able to do complex queries in SQL.
So, that is why I ask.
Ok what you can do is create a custom sql and publish it as datasource, once you have dont that they will get desired rows and columns , so every time they open this anlytics max would be populating.
I dont think you can use a max in where clause as you have specified.
Indeed, everything but that MAX can be expressed quite easily in Tableau:
- Join conditions between fields should be set in the relation (on Data Source tab)
- Everything else is filters, including B.Code01 = "OK"
Problem with MAX filter is that it goes against different relation. If it would be against same relation then it would be possible to express it via Condition filter.