Color Formatting on Directionality

Hi Community, Thanks in advance for your help!

I'm trying to highlight directionality of referrer's volumes. I want to compare to each referrer's prior month, not to a total or to an absolute value.

For example, we can see that Jacob dropped off in April. We can see that Bob and Smith are trending upwards. These insights can be gained easily with the colors in the chart.

This is easy to accomplish in Excel, but I can't make it happen in Domo.

Perhaps a table isn't the best way to communicate this, but it's what we've always used.

Can you help me color code a table based on trends per referrer? Do you have other ideas for how to best communicate this metric?

Best Answers

  • ArborRose
    ArborRose Coach
    Answer ✓

    One way to do it might be to organized columns: Referer, January, February, March, April, May….

    Create calculated fields for month to month changes. Such as

    CASE
    WHEN `February` > `January` THEN 1
    WHEN `February` < `January` THEN -1
    ELSE 0
    END

    And create similar calculations fields for every month pair. Then set up conditional formatting rules such as

    Condition: Feb_vs_Jan = 1 (increase)
    Format: Set the background color to a shade of green.

    Condition: Feb_vs_Jan = -1 (decrease)
    Format: Set the background color to a shade of red.

    Condition: Feb_vs_Jan = 0 (no change)
    Format: Set the background color to yellow or any neutral color.

    (Obviously you could do this with month values as integers as well.)

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • DavidChurchman
    Answer ✓

    Short answer: there's not really an easy way to do this.

    A) HTML format each column

    You can use HTML coding in an HTML table to hard code formatting like this. If you have a wide data structure, each month's formula could look something like this:

    CONCAT('<div style=color:#000000>',
    Case
    when February = January then ''
    when February > January then '<span style=color:#0072B2>▴</span>'
    when February < January then '<span style=color:#D55E00>▾</span>'
    END,
    February,
    '</div>')

    I tend to like icons over full cell shading, which I think overpowers the data, but you can also apply background colors using HTML:

    https://domo-support.domo.com/s/article/360043430033?language=en_US

    This is super manual, and to fully replicate your example, the logic would get pretty long to be able to have the first increase = orange, the second = yellow and so on. Not to mention you need a separate BM for every column.

    If your data is long, you could do something similar using an ETL or period-over-period BeastMode to figure out if the prior month was less or more than the current month.

    B) Flex Table

    If you data is in long format, a Flex Table can sketch a plot for each referrer, which gets at your aim of being able to quickly see trends. Pros: no BeastModes needed and works out of the box. Cons: kind of ugly out of the box, and not enough ways to customize, IMO:

    C) Multi line

    If you really only have 5 referrers, nothing really beats a line chart for seeing trends over time, both inter- and intra-referrer:

    D) Norm your values

    If your primary concern is seeing the trend since January, 0 out your values at January, and make them "distance from January". Color code on that.

    Please 💡/💖/👍/😊 this post if you read it and found it helpful.

    Please accept the answer if it solved your problem.

Answers

  • ArborRose
    ArborRose Coach
    Answer ✓

    One way to do it might be to organized columns: Referer, January, February, March, April, May….

    Create calculated fields for month to month changes. Such as

    CASE
    WHEN `February` > `January` THEN 1
    WHEN `February` < `January` THEN -1
    ELSE 0
    END

    And create similar calculations fields for every month pair. Then set up conditional formatting rules such as

    Condition: Feb_vs_Jan = 1 (increase)
    Format: Set the background color to a shade of green.

    Condition: Feb_vs_Jan = -1 (decrease)
    Format: Set the background color to a shade of red.

    Condition: Feb_vs_Jan = 0 (no change)
    Format: Set the background color to yellow or any neutral color.

    (Obviously you could do this with month values as integers as well.)

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • DavidChurchman
    Answer ✓

    Short answer: there's not really an easy way to do this.

    A) HTML format each column

    You can use HTML coding in an HTML table to hard code formatting like this. If you have a wide data structure, each month's formula could look something like this:

    CONCAT('<div style=color:#000000>',
    Case
    when February = January then ''
    when February > January then '<span style=color:#0072B2>▴</span>'
    when February < January then '<span style=color:#D55E00>▾</span>'
    END,
    February,
    '</div>')

    I tend to like icons over full cell shading, which I think overpowers the data, but you can also apply background colors using HTML:

    https://domo-support.domo.com/s/article/360043430033?language=en_US

    This is super manual, and to fully replicate your example, the logic would get pretty long to be able to have the first increase = orange, the second = yellow and so on. Not to mention you need a separate BM for every column.

    If your data is long, you could do something similar using an ETL or period-over-period BeastMode to figure out if the prior month was less or more than the current month.

    B) Flex Table

    If you data is in long format, a Flex Table can sketch a plot for each referrer, which gets at your aim of being able to quickly see trends. Pros: no BeastModes needed and works out of the box. Cons: kind of ugly out of the box, and not enough ways to customize, IMO:

    C) Multi line

    If you really only have 5 referrers, nothing really beats a line chart for seeing trends over time, both inter- and intra-referrer:

    D) Norm your values

    If your primary concern is seeing the trend since January, 0 out your values at January, and make them "distance from January". Color code on that.

    Please 💡/💖/👍/😊 this post if you read it and found it helpful.

    Please accept the answer if it solved your problem.