Conditional Formatting One Column Based on a Different Column's Value
Hello,
Working with a table and attempting to change the color/format of "Column A" based on the value of "Column B" . I understand that I am able to change the format of the entire row or only Column B based on Column B's value, but not one specified column. Are there any settings in "Chart Properties" that I am missing? Or, perhaps, there is a Beast Mode to work around this? Thanks in advance for any help.
Best Answer
-
Hi,
I think that you have to go with the old method of HTML injection in this case.
Try this beast mode for Red BackGround:
CASE WHEN `ColumnA`='ColumnB' THEN
CONCAT('<div style="background-color:#fcbcb7; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `ColumnA`, '</a></div>')
ENDChange the background-color: to the desired colors, you can also use other HTML attributes.
You can get your HTML color codes from this site:
Hope this helps. Don't hesitate to ask in you need further help.
Ricardo Granada
MajorDomo@Lusiaves
**If the post solves your problem, mark it by clicking on "Accept as Solution"
**You can say "Thank you" by clicking the thumbs up in the post that helped you.0
Answers
-
Hi,
I think that you have to go with the old method of HTML injection in this case.
Try this beast mode for Red BackGround:
CASE WHEN `ColumnA`='ColumnB' THEN
CONCAT('<div style="background-color:#fcbcb7; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `ColumnA`, '</a></div>')
ENDChange the background-color: to the desired colors, you can also use other HTML attributes.
You can get your HTML color codes from this site:
Hope this helps. Don't hesitate to ask in you need further help.
Ricardo Granada
MajorDomo@Lusiaves
**If the post solves your problem, mark it by clicking on "Accept as Solution"
**You can say "Thank you" by clicking the thumbs up in the post that helped you.0 -
I have a new wrinkle to add to this problem. I would like to create a card that has one row for each account. Then I want to have a separate column for each of several different products. The trick is that I then want to be able to format the color of the values in each column based on the competitor name.
I have tried this by using the following beastmode:
CASE
WHEN `Product Group`='Product A' THEN
CASE
WHEN `competitor_name__c`='Competitor A' THEN
CONCAT('<div style="background-color:#7EAEFD; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `Product Group TAM`,'</div>')
WHEN `competitor_name__c`='Competitor B' THEN
CONCAT('<div style="background-color:#00FF00; width: 100%; height:100%; margin:-20px; padding:20px"><a href="#">', `Product Group TAM`,'</div>')(... continued for a number of competitors, but you get the idea)
ELSE '0'
END
ENDI then repeat this beast mode for `Product B`
The issue is that when I put these beastmodes on the table card, I am getting multiple rows for each account name.The orange box is for one account, I want this on one line
Any thoughts on how to accomplish this?
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
Can you wrap each of your product columns in a single MAX() function (ie MAX( CASE WHEN `Product.... END) ? That's what I've done in SQL in this kind of circumstance before and it's worked.
Aaron
MajorDomo @ Merit Medical
**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"0 -
Nice solution, however the code will show if you try exporting the data.
I wish there was a conditional formatting solution built into the card design that would allow this natively so the data in the card itself wouldn't need to be manipulated.
We have a use case where we need the output to remain valid/exactly as it is but would like to alert/call out potential issues with the data by highlighting them on the card before someone tries to export it.
Thanks,
--Nick
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