On the table card, once you've enabled "Show Subtotal Rows", has anyone else encountered issues with it forcing the first row to be the primary field?
I've got a few cards where the first row is a formatted date (or some other non-numeric value) that looks like "January 2018" for several months. I love the ability to be able to have subtotals so I can aggregate other dimensions in the table. However, with it forcing the first column to be the primary sort field, the only way i've found to try to get it to display in the correct order is something like this:
CONCAT(
CASE
WHEN MONTH(`Date`) = MONTH(CURDATE()) AND YEAR(`Date`) = YEAR(CURDATE()) THEN 1
WHEN MONTH(`Date`) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND YEAR(`Date`) = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) THEN 2
WHEN MONTH(`Date`) = MONTH(DATE_SUB(CURDATE(), INTERVAL 2 MONTH)) AND YEAR(`Date`) = YEAR(DATE_SUB(CURDATE(), INTERVAL 2 MONTH)) THEN 3
WHEN MONTH(`Date`) = MONTH(DATE_SUB(CURDATE(), INTERVAL 3 MONTH)) AND YEAR(`Date`) = YEAR(DATE_SUB(CURDATE(), INTERVAL 3 MONTH)) THEN 4
WHEN MONTH(`Date`) = MONTH(DATE_SUB(CURDATE(), INTERVAL 4 MONTH)) AND YEAR(`Date`) = YEAR(DATE_SUB(CURDATE(), INTERVAL 4 MONTH)) THEN 5
WHEN MONTH(`Date`) = MONTH(DATE_SUB(CURDATE(), INTERVAL 5 MONTH)) AND YEAR(`Date`) = YEAR(DATE_SUB(CURDATE(), INTERVAL 5 MONTH)) THEN 6
WHEN MONTH(`Date`) = MONTH(DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) AND YEAR(`Date`) = YEAR(DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) THEN 7
END,
'. ', MONTHNAME(`Date`), ' ', YEAR(`Date`))
Which this appends a number based on how far back the month is. So I end up with "1. January 2018" or "2. December 2017".
Has anyone else found a better solution to this issue? Or maybe there's an option to disable subtotal sort that I'm just blanking on.
Sincerely,
ValiantSpur