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
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive