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)

)


Tagged:

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>')

  • 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.

This discussion has been closed.