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.4K Product Ideas
- 1.4K Ideas Exchange
- 1.4K Connect
- 1.2K Connectors
- 284 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.9K Transform
- 88 SQL DataFlows
- 554 Datasets
- 2.2K Magic ETL
- 3.3K Visualize
- 2.3K Charting
- 564 Beast Mode
- 9 App Studio
- 27 Variables
- 577 Automate
- 140 Apps
- 414 APIs & Domo Developer
- 22 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 350 Distribute
- 90 Domo Everywhere
- 258 Scheduled Reports
- 2 Software Integrations
- 91 Manage
- 88 Governance & Security
- 9 Product Release Questions
- Community Forums
- 42 Getting Started
- 28 Community Member Introductions
- 85 Community Announcements
- 4.8K Archive