You want to use beautiful colors from the Atlassian Design System to format cells' background conditionally: these colors will be automatically adjusted for Light and Dark Confluence themes.
Enter the following SQL query:
SELECT *, CASE WHEN T1.'Amount of Transactions' < 30 THEN FORMATWIKI("{cell:background-color=var(--ds-background-accent-red-subtlest, red)}", T1.'Amount of Transactions', "{cell}") WHEN T1.'Amount of Transactions' >= 30 AND T1.'Amount of Transactions' < 80 THEN FORMATWIKI("{cell:background-color=var(--ds-background-accent-yellow-subtlest, yellow)}", T1.'Amount of Transactions', "{cell}") ELSE FORMATWIKI("{cell:background-color=var(--ds-background-accent-green-subtlest, green)}", T1.'Amount of Transactions', "{cell}") END AS 'Amount of Transactions' FROM T* |
Save the macro and the page.
The syntax for the FORMATWIKI function looks as following:
FORMATWIKI("{cell:background-color=var(--ds-background-accent-red-subtlest, red)}", T1.'Amount of Transactions', "{cell}")
Here the "--ds-background-accent-red-subtlest" part is a color token that we copy from the Atlassian Design System. The "red" part is an alternative Confluence color that is used by default (for example, if there is no such token in the system because you've copied the query to another instance with an old Confluence version).