Shape Gauges inside Mega Table?
Hello,
I'm creating a mega table showing previous month and current month and was wanting to create a column with up, down, no change icons and thought of the shape gauges. Is it possible to nest a shape gauge icon inside a mega table? Any advice on doing so would be appreciated.
Thanks,
Jason
Best Answer
-
Hi Jason / @user007486
You're not able to nest cards inside of cards however how I've done it in the past is to utilize some beast modes and some unicode characters like the following (this is calculating YOY % - you can adapt as necessary):
```
concat(
case
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) > 0 then '<div><span style="color: green">'
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) < 0 then '<div><span style="color: red">'
else '<div><span style="color: black">'
end,
case
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) > 0 then ' ⇧ '
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) < 0 then ' ⇩ '
else ''
end
,
round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0),
'%',
'</div>')```
This highlights the color in red for negative, black for 0 and green for positive along with displaying an up or down arrow. It may not work in a Mega table but will work in an HTML table. - You could remove the <div> markups and forgo the coloring in favor of just the up and down arrows in a mega table.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Answers
-
Hi Jason / @user007486
You're not able to nest cards inside of cards however how I've done it in the past is to utilize some beast modes and some unicode characters like the following (this is calculating YOY % - you can adapt as necessary):
```
concat(
case
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) > 0 then '<div><span style="color: green">'
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) < 0 then '<div><span style="color: red">'
else '<div><span style="color: black">'
end,
case
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) > 0 then ' ⇧ '
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) < 0 then ' ⇩ '
else ''
end
,
round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0),
'%',
'</div>')```
This highlights the color in red for negative, black for 0 and green for positive along with displaying an up or down arrow. It may not work in a Mega table but will work in an HTML table. - You could remove the <div> markups and forgo the coloring in favor of just the up and down arrows in a mega table.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
@GrantSmith that's a nice idea. I'll see if I can make that work.
I'm realizing now my math is going to be a little complicated since I'm trying to get the difference of two ratios. I think that needs to be done via ETL or Dataflow, correct?
Anyway, thanks for the tip. I think that'll work.
0 -
you don't necessarily have to hardcode the ratios into the data. In fact. Don't do that, it makes it so your card doesn't respond to filters.
instead use nested case statements
instead of ..
concat(
case
when round(SUM(`This Year` - `Last Year`) / SUM(`Last Year`) * 100, 0) > 0 then '<div><span style="color: green">'
...try
concat(
case whenround(
SUM(case when ... numerator for this year) / sum(case ... denominator for this year)
-
sum(case numerator for last year) / sum( case denominator for last year) * 100, 0) > 0 then '<div><span style="color: green">'
..Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive