The LookML is correct, and I believe the long SQL comes from Transactions_id being declared as a primary_key. I’m not sure what Looker is doing exactly with the SQL, but I assume it’s making sure it only counts each Transaction_ID’s value once.
Precisely! This is a super useful Looker feature that can seem pretty weird when you first click on that “SQL” tab. @Mintz wrote a great piece about it here:
There actually are some ways to “turn it off”. But, it’s generally doing pretty important work to keep your numbers from being wrong, so you should make sure that your numbers look right both before and after turning it off. And generally, you really shouldn’t turn it off.
Note that this won’t work with the filters parameter you’ve applied, since that doesn’t work on type: number measures.
so tl;dr— You didn’t do anything wrong, this is Looker working hard to keep your data correct. Read that post by mintz, check your join relationships to make sure they’re hunky-dory, and if you absolutely must (or just to satisfy curiousity), you can play with disabling sym-aggs with those two methods above. For more, read Lloyd’s explanation too: