Cards, Dashboards, Stories

Cards, Dashboards, Stories

Arrow Trend an Color Condition Format

Hi, I'm new to Domo!


I’ve successfully applied basic color formatting in the chart properties of a bar chart, but I’m having trouble with more complex color formatting. Specifically, I want to format colors based on conditions like comparing current percentages to values from the previous year. I couldn’t find it in Analyzer and there's no relevant tutorial on YouTube.

I’m also planning to create a table view that includes trend arrows and color formatting. Any tips or resources on these topics would be greatly appreciated!

Thank you so much.




*PY - Previous Year

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Best Answer

Answers

  • Answer ✓

    This thread may be relevant to you as far as the colored directional arrow.

    I made this video a while back about the color options in Domo. It may be helpful to you.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • You may want to look into Flex Tables as an option, but usually what I end up doing in these situations is use an HTML Table so that I can customize the Arrows, Colors, Rules, etc.

    Below is just a basic example, but you can see how the beast mode can get very complex with even simple examples:

    1. /*
    2. Growth Indicator
    3. */
    4. CONCAT(
    5. '<div style="" title="% Change from Previous Row">'
    6. , CASE
    7. WHEN
    8. (
    9. /*
    10. VIN Count Growth
    11. (current value - prior value) / prior value
    12. */
    13. (
    14. /* Sum VIN Count */
    15. SUM(`VIN count`)
    16. -

    17. /* Lag VIN Count */
    18. lag(
    19. /* Sum VIN Count */
    20. SUM(`VIN count`)
    21. ) over (order by `Date`)
    22. )

    23. /

    24. /* Lag VIN Count */
    25. lag(
    26. /* Sum VIN Count */
    27. SUM(`VIN count`)
    28. ) over (order by `Date`)
    29. ) > 0
    30. THEN CONCAT(
    31. '<span style="color:MediumSeaGreen;">'
    32. ,'<img height="10px" src="https://upload.wikimedia.org/wikipedia/commons/7/73/Basic_triangle.svg"> '
    33. , /*
    34. String VIN Count Growth
    35. */
    36. CONCAT(
    37. ROUND(
    38. (
    39. /*
    40. VIN Count Growth
    41. (current value - prior value) / prior value
    42. */
    43. (
    44. /* Sum VIN Count */
    45. SUM(`VIN count`)
    46. -

    47. /* Lag VIN Count */
    48. lag(
    49. /* Sum VIN Count */
    50. SUM(`VIN count`)
    51. ) over (order by `Date`)
    52. )

    53. /

    54. /* Lag VIN Count */
    55. lag(
    56. /* Sum VIN Count */
    57. SUM(`VIN count`)
    58. ) over (order by `Date`)
    59. ) * 100
    60. , 2)
    61. , '%')
    62. ,'</span>'
    63. )
    64. WHEN
    65. (
    66. /*
    67. VIN Count Growth
    68. (current value - prior value) / prior value
    69. */
    70. (
    71. /* Sum VIN Count */
    72. SUM(`VIN count`)
    73. -

    74. /* Lag VIN Count */
    75. lag(
    76. /* Sum VIN Count */
    77. SUM(`VIN count`)
    78. ) over (order by `Date`)
    79. )

    80. /

    81. /* Lag VIN Count */
    82. lag(
    83. /* Sum VIN Count */
    84. SUM(`VIN count`)
    85. ) over (order by `Date`)
    86. ) < 0
    87. THEN CONCAT(
    88. '<span style="color:red;" title="">'
    89. , '<img height="10px" src="https://upload.wikimedia.org/wikipedia/commons/e/ed/Decrease2.svg">'
    90. , /*
    91. String VIN Count Growth
    92. */
    93. CONCAT(
    94. ROUND(
    95. (
    96. /*
    97. VIN Count Growth
    98. (current value - prior value) / prior value
    99. */
    100. (
    101. /* Sum VIN Count */
    102. SUM(`VIN count`)
    103. -

    104. /* Lag VIN Count */
    105. lag(
    106. /* Sum VIN Count */
    107. SUM(`VIN count`)
    108. ) over (order by `Date`)
    109. )

    110. /

    111. /* Lag VIN Count */
    112. lag(
    113. /* Sum VIN Count */
    114. SUM(`VIN count`)
    115. ) over (order by `Date`)
    116. ) * 100
    117. , 2)
    118. , '%')
    119. , '</span>'
    120. )
    121. ELSE '<span style="color:Gray;">-</span>'
    122. END
    123. , '</div>'
    124. )
  • Wow, there's some neat stuff going on in this post. We need @Eddie Small to get these three on a talkabout. (Sorry, I made up that word because it's late on a Friday and I can't remember what Eddie calls those neat online get-togethers.)

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

  • Thank you so much, @MarkSnodgrass and @ggenovese!

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In