Changing Font Color based on a formula
I'm trying to change the color of a number and when I do DOMO reads it as text instead. When I try to CAST it back to a number it zeroes out.
Here is what works but it reads as text:
concat('<span style="color:green">',(SUM(`Base_NMU`)/MAX(`Base_SalesCumm`)), '</span>')
Any help would be greatly appreciated
Best Answer
-
Unfortunately, you won't be able to get something like that unless you do your aggregations within a MySQL DataFlow or Magic ETL. Something like ...
select team
,department
,new_members
,old_members
,net_members
from team_file
union all
select 'Subtotal' as team
,department
,sum(new_members) as new_members
,sum(old_members) as old_members
,sum(net_members) as net_members
from team_file
group by department
union all
select 'Total' as team
,'All' as department
,sum(new_members) as new_members
,sum(old_members) as old_members
,sum(net_members) as net_members
from team_fileIf your grouped columns were by team and department and then you wanted a subtotal on department, and an all-in total you would write the SQL like the above. Then when it processes you can use the HTML beastmode and it won't matter if it's a text because you will already have subtotals and totals.
Hope this helps,
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.1
Answers
-
What is the end result you are trying to achieve. Could you please provide an example?
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
I'm trying to show all positive numbers that contribute to our net gain in green, net loss in red and so on
New Member Counts = Green
Cancellation Counts = Red
Net Members = Green/Red depending if its a positive or negative.
0 -
Using the concat in a beastmode with html will always turn your numbers to text.
Why do you need to show them as numbers?
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
These are subtotaled by region as well as having a grand total. DOMO reads them as text so the subtotals/grand totals blank out.
0 -
Have you considered using a heat map table? This way you can control the colors of the cells if they are negative or positive, keep them as numbers, and be able to do a subtotal/grandtotal. This option wouldn't even require you to write a beastmode with HTML.
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 -
It doesn't give me the result/view I'm looking for. I'm looking for something like this:
0 -
Unfortunately, you won't be able to get something like that unless you do your aggregations within a MySQL DataFlow or Magic ETL. Something like ...
select team
,department
,new_members
,old_members
,net_members
from team_file
union all
select 'Subtotal' as team
,department
,sum(new_members) as new_members
,sum(old_members) as old_members
,sum(net_members) as net_members
from team_file
group by department
union all
select 'Total' as team
,'All' as department
,sum(new_members) as new_members
,sum(old_members) as old_members
,sum(net_members) as net_members
from team_fileIf your grouped columns were by team and department and then you wanted a subtotal on department, and an all-in total you would write the SQL like the above. Then when it processes you can use the HTML beastmode and it won't matter if it's a text because you will already have subtotals and totals.
Hope this helps,
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.1 -
Yea that's a good point. I appreciate the help and time on this!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 682 Automate
- 175 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive