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.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 737 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive