Yes the query object is great! When you need to create special combined datasets, then a Query can do it much faster. For example this is what analysis by dimensions uses, where it combines the entries with the dimension values. If you had to do the same thing the traditionel way with "loop-in-loops" with lots of repeat-until's, then you would need a lot more SQL reads. But there is typically a lot more work involved in using them, so only do it when you really need it, which is where you either have a large number of transactions. To me especially the group by and sums from SQL comes in very handy. The best way to learn how to use it is to study how it's being used in the standard system. My guess is that the "Top 10 Customer Sales" query is one of the simpler to start with.
↧