Adding a MOM or YOY value in top of card
Is there a way to incorporate MOM or YOY comparisons within cards? Similar to the visual below (which is in Power BI)?
Answers
-
I'd recommend restructuring your data to have multiple different periods in the same graph. I've done a write up in the past on how to accomplish this here: https://dojo.domo.com/discussion/53481/a-more-flexible-way-to-do-period-over-period-comparisons#latest
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thank you. Can you share a screenshot of what this would look like on a card/dashbaord?
0 -
You can use the summary number field to display this information. Read this post here on how to do the directional arrows, specifically cwolman's post on June 2019.
Alternatively, you can build a dashboard and use the multi-value gauge and lay them out in an order similar to your screenshot. If all the cards are built off the same dataset, they will filter the same when page filters or other filters are applied.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
@MarkSnodgrass I think I got this figured out for the most part, but am currently hung up on the initial value... I'd like the summary to say 1,319,412 [arrow] -1% [arrow] -2% MOM. However, Domo is separating the value and the follow on YOY/MOM indicators... How do I get them on one line? And how can I have value format have commas so it is 1,319,412 instead of 1319412? Below is a screenshot and the Beastmode calculation I have...
Concat(
'<div style="font-size:15px">',
CONCAT(sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end), case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) > 0 then '<div style="color: green">'
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) < 0 then '<div style="color: red">'
else '<div style="color: black">' end,
case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) < 0 then '⇩ '
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) > 0 then '⇧ '
else ' ' end, round(((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end)))*100,0), '%', ' YOY ', case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))) < 0 then '⇩ '
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))) > 0 then '⇧ '
else ' ' end, round(((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end)))*100,0), '%', ' MOM'))
0 -
@NathanDorsch The div tags cause them to be on separate lines. I haven't played around with formatting it like you want too much, but you could try div style="float:left" for your first div and div style="float:right" for your 2nd div. Here's a link to more info on the css style.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1 -
@MarkSnodgrass or @GrantSmith or anyone who can help.... I have spent several hours working on this and cannot figure this out! I couldn't seem to get the div style="float:left" working... then I tried '<div align=left>' and right... to no avail
What am I doing wrong? There's got to be a way to do this... :-(
Below is my current beastmode calc
Concat(
-- Size 15px
'<div style="font-size:15px">',
-- Color green YOY and up arrow
CONCAT( '<div align=left>', case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -3 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) > 0 then '<div style="color: green">''⇧ '
-- color red YOY and down arrow
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -3 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) < 0 then '<div style="color: red">''⇩ '
-- color black YOY and no arrow
else '<div style="color: black">' end,
-- Value YOY
round(((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -3 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -4 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end)))*100,0), '%', ' YOY ',
-- Green arrow MOM and up arrow
CONCAT('<div align=right>', case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -3 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -4 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -4 then `Sessions` end))) > 0 then '<div style="color: green">''⇧ '
-- color red MOM and down arrow
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -3 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -4 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -4 then `Sessions` end))) < 0 then '<div style="color: red">''⇩ '
-- color black MOM and no arrow
else '<div style="color: black">' end,
-- Value MOM
round(((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -3 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -4 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -4 then `Sessions` end)))*100,0), '%', ' MOM')))
0 -
@MarkSnodgrass I think I got this figured out for the most part, but am currently hung up on the initial value... I'd like the summary to say 1,319,412 [arrow] -1% [arrow] -2% MOM. However, Domo is separating the value and the follow on YOY/MOM indicators... How do I get them on one line? And how can I have value format have commas so it is 1,319,412 instead of 1319412? Below is a screenshot and the Beastmode calculation I have...
Concat(
'<div style="font-size:15px">',
CONCAT(sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end), case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) > 0 then '<div style="color: green">'
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) < 0 then '<div style="color: red">'
else '<div style="color: black">' end,
case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) < 0 then '⇩ '
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end))) > 0 then '⇧ '
else ' ' end, round(((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -13 then `Sessions` end)))*100,0), '%', ' YOY ', case when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))) < 0 then '⇩ '
when ((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))) > 0 then '⇧ '
else ' ' end, round(((sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -1 then `Sessions` end) - sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end))
/ (sum(case when PERIOD_DIFF(date_format(`Date`,'%Y%m'),date_format(now(),'%Y%m')) = -2 then `Sessions` end)))*100,0), '%', ' MOM'))
0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 292 Workbench
- 4 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 95 SQL DataFlows
- 602 Datasets
- 2.1K Magic ETL
- 3.7K Visualize
- 2.4K Charting
- 695 Beast Mode
- 43 App Studio
- 39 Variables
- 658 Automate
- 170 Apps
- 441 APIs & Domo Developer
- 42 Workflows
- 5 DomoAI
- 32 Predict
- 12 Jupyter Workspaces
- 20 R & Python Tiles
- 386 Distribute
- 111 Domo Everywhere
- 269 Scheduled Reports
- 6 Software Integrations
- 113 Manage
- 110 Governance & Security
- 8 Domo University
- 30 Product Releases
- Community Forums
- 39 Getting Started
- 29 Community Member Introductions
- 98 Community Announcements
- Domo Community Gallery
- 4.8K Archive