Using Multiple Summary numbers, Concat() HTML for color rules, how to get all numbers on same line?
See attached screenshot. Trying to use multiple summary numbers and get the numbers to line up alongside each other (KWH KAU DBA ect), rather than stacking.
Beastmode to generate numbers:
CONCAT(
--KWH
(CASE
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .9
THEN CONCAT(
'<div style="background-color:transparent; color:#58D600; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'KWH', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .9
AND
((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ffcc00; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'KWH', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ff0505; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'KWH', '</div>')
END),
--KAU
(CASE
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Qualified Goal/ 12` END)) >= .9
THEN CONCAT(
'<div style="background-color:transparent; color:#58D600; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'KAU', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Qualified Goal/ 12` END)) < .9
AND
((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Qualified Goal/ 12` END)) >= .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ffcc00; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'KAU', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kauai' THEN `Qualified Goal/ 12` END)) < .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ff0505; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'KAU', '</div>')
END),
--DBA
(CASE
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Dancing Bear Aspen' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .9
THEN CONCAT(
'<div style="background-color:transparent; color:#58D600; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'DBA ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Dancing Bear Aspen' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .9
AND
((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Dancing Bear Aspen' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ffcc00; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'DBA ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Dancing Bear Aspen' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ff0505; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'DBA ', '</div>')
END),
--TSV
(CASE
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Residences at The Sebastian' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .9
THEN CONCAT(
'<div style="background-color:transparent; color:#58D600; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'TSV ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Residences at The Sebastian' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .9
AND
((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Residences at The Sebastian' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ffcc00; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'TSV ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Residences at The Sebastian' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ff0505; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'TSV ', '</div>')
END),
--CDC
(CASE
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Castello di Casole' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .9
THEN CONCAT(
'<div style="background-color:transparent; color:#58D600; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'CDC ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Castello di Casole' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .9
AND
((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Castello di Casole' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ffcc00; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'CDC ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Castello di Casole' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ff0505; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'CDC ', '</div>')
END),
--JUP
(CASE
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Jupiter' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .9
THEN CONCAT(
'<div style="background-color:transparent; color:#58D600; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'JUP ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Jupiter' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .9
AND
((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Jupiter' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ffcc00; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'JUP ', '</div>')
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Jupiter' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .8
THEN CONCAT(
'<div style="background-color:transparent; color:#ff0505; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">', 'JUP ', '</div>')
END)
)
Comments
-
I think you may need to wrap all of your conditionals in the same html concat instead of individually
Something like
CONCAT(
'<div style="background-color:transparent; color:#ff0505; font-weight:bold; width: 100%; height:100%; margin-right:10px; padding:20px;">',WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .9
THEN 'KWH'
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .9
AND
((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) >= .8
THEN 'KWH'
WHEN ((COUNT(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Campaign.Name` END)) / MAX(CASE WHEN `Analyzer_Domo_Property__c` = 'Timbers Kiawah' THEN `Qualified Goal/ 12` END)) < .8
THEN 'KWH'
END)
'</div>')Domo Consultant
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Hi mfaas,
I believe you may want to use <span> instead of <div>
The <div> element is block-line, which is equivalent to having a line-break before and after it.
Here is an example of something I have written using HTML in beastmode. I use <span> but when I actually want a line break I use the <br> element.
CONCAT(MONTHNAME(CURRENT_DATE())
,' Projection: $'
,ROUND(sum(case when `measure` = 'Projected' then `metric` end)/1000,2)
,'k<br>'
,CASE WHEN sum(case when `measure` = 'Projected' then `metric` end) < sum(case when `measure` = 'Goal' then CASE WHEN `measure` = 'Goal' and `metric_category` like '%Churned%' then `metric`*-1 else `metric` end end)
THEN CONCAT('<span style="color: red">','▼')
ELSE CONCAT('<span style="color: green">','▲')
END
,round((ROUND((sum(case when `measure` = 'Projected' then `metric` end) - sum(case when `measure` = 'Goal' then CASE WHEN `measure` = 'Goal' and `metric_category` like '%Churned%' then `metric`*-1 else `metric` end end)),2))/abs(sum(case when `measure` = 'Goal' then CASE WHEN `measure` = 'Goal' and `metric_category` like '%Churned%' then `metric`*-1 else `metric` end end))*100,0)
,'% </span>vs. Plan, '
,CASE WHEN sum(case when `measure` = 'Projected' then `metric` end) < sum(case when `measure` = 'PY' then `metric` end)
THEN CONCAT('<span style="color: red">','▼')
ELSE CONCAT('<span style="color: green">','▲')
END
,round((ROUND((sum(case when `measure` = 'Projected' then `metric` end) - sum(case when `measure` = 'PY' then `metric` end)),2))/abs(sum(case when `measure` = 'Projected' then `metric` end))*100,0)
,'% </span>YoY')Hope this helps.
Thanks,
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0
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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 36 Predict
- 15 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