Custom Mode breaks variance percentage?

Hi @MatthewWalsh ,
One thing I would suggest, is look at the error logs under your name after you execute the query, this should shed light as to what the issue is. My gut feel is this will be a DIV/0 error. You can get around this by adjusting your code to have the following logic:

^{a}/nullif({b},0)

Using this code will inspect the divsor ({b}), if the number is 0 (which would cause div/0) we mark it as NULL and therefore it returns 0. If you want to do something else other than 0 then you can use a case statement. Have a look at this post where I document how you use SQL commands within Custom Mode.

https://pug.phocassoftware.com/t/percentage-share-in-custom-mode/

Regards,

Jon