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.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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive