HTML Card | Background Color Style
cmoreno
Member
I have an HTML Card that breaks down products by level. In my beast modes I have each level (0-6) set to a particular color as long as the number of accounts is > 0 otherwise it's set to a white background. My code seems to work for every level except for the first, 0, and I can't seem to figure out why.
CASE WHEN COUNT(DIOM Level Acc # (chessboard)
) >= 1 THEN
(CASE
WHEN `Level` = 0 THEN
CONCAT('<div style="background=color: #99DBF3; color:black; margin:-20px; padding:20px">', CONCAT('Level 0: Sales $0','<br>', '<span style="font-weight: 800">' ,COUNT(`DIOM Level Acc # (chessboard)`),' Accounts','</span>'),'</div>')
WHEN `Level` = 1 THEN
CONCAT('<div style="background-color: #66CAEE; color:black; margin:-20px; padding:20px">', CONCAT('Level 1: Sales < $2000','<br>', '<span style="font-weight: 800">', COUNT(`DIOM Level Acc # (chessboard)`),' Accounts', '</span>'),'</div>')
WHEN `Level` = 2 THEN
CONCAT('<div style="background-color: #33B8E8; color:black; margin:-20px; padding:20px">', CONCAT('Level 2: Sales < $10,000', '<br>', 'or' ,'<br>','1+ Trained Facilitator','<br>','<span style="font-weight: 800">', COUNT(`DIOM Level Acc # (chessboard)`),' Accounts','</span>'),'</div>')
WHEN `Level`= 3 THEN
CONCAT('<div style="background-color: #00A6E2; color:black; margin:-20px; padding:20px">', CONCAT('Level 3: Sales < $25,000','<br>', 'or', '<br>', '3+ Trained Facilitator','<br>', '<span style="font-weight: 800">',COUNT(`DIOM Level Acc # (chessboard)`),' Accounts', '</span>'),'</div>')
WHEN `Level` = 4 THEN
CONCAT('<div style="background-color: #0094D0; color:white; margin:-20px; padding:20px">', CONCAT('Level 4: Sales < $50,000','<br>','<span style="font-weight: 800">', COUNT(`DIOM Level Acc # (chessboard)`),' Accounts','</span>'),'</div>')
WHEN `Level` = 5 THEN
CONCAT('<div style="background-color: #0082BE; color:white; margin:-20px; padding:20px">',CONCAT('Level 5: Sales < $100,000','<br>','<span style="font-weight: 800">', COUNT(`DIOM Level Acc # (chessboard)`),' Accounts', '</span>'),'</div>')
WHEN `Level` = 6 THEN
CONCAT('<div style="background-color: #006FAD; color:white; margin:-20px; padding:20px">', CONCAT('Level 6: Sales > $100,000','<br>', '<span style="font-weight: 800">', COUNT(`DIOM Level Acc # (chessboard)`),' Accounts', '</span>'),'</div>')
END)
0
Answers
-
You have a typo in your style
<div style="background=color
should be <div style="background-color
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive