How to use filters to calculate MTD, QTD & YTD using 3 different cards?
We need 3 filters for Month, Quarter & Year and using the same we want to drive the cards to be show MTD, QTD & YTD calculations on same page. Please note MTD, QTD & YTD as 3 different Bar Graph charts.
Is there any easy way to achievr this? Currently we are exploring Parameters/variables.
Best Regards,
Tejal
Best Answers
-
Interesting that so many suggest variables or parameters. I don't even think I'm using variables for anything.
I have posted examples previously with the way I do this. I create an ETL with aggregates that include fields for CY, PY, P2Y, etc. The same aggregate tiles include calculations for MTD, QTD, etc. For things like MTD or QTD, you just add more criteria for whether your date field is whatever quarter or month, or less than current month, etc.
CY:
sum(
case when YEAR(date
) = YEAR(CURRENT_DATE())
anddate
<= CURRENT_DATE()
thenamount
else 0 end
)
PY:
sum(
case when YEAR(date
) = YEAR(CURRENT_DATE())-1
anddate
<= DATE_ADD(CURRENT_DATE(),-365)
thenamount
else 0 end
)
or
sum(
case when YEAR(date
) = YEAR(DATE_ADD(CURRENT_DATE(),-365))
anddate
<= DATE_ADD(CURRENT_DATE(),-365)
thenamount
else 0 end
)** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1 -
I think you could do all of this with no BeastModes or Variables.
A variable would be useful if you were trying to do this all with one card, with the ability to switch the metric from MTD, QTD, YTD, but you want to use three different cards, so you can easily define the "graph by" on each card using the date options.
I also don't think you need three filters. Based on my reading of your PDF, all three filters you describe are basically saying the start date you want to be used. The simplest implementation would be a "range selector", card where users can adjust the date range to be displayed.
Also based on your PDF, it seems like you want to compare to the prior year. Use a period-over-period card, and you should be able to do that, as well as define whether it's a by-month, by-quarter or by-year card.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0
Answers
-
@TejalGovila - I would say that variables are probably your best bet. You would want to define the logic for the date ranges and then use that variable inside of a case statement. You can then place the variable on to a dashboard as a control, and let users toggle.
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**1 -
Hi @TejalGovila , Here is a good example page of a few types of variables used to show different time slices.
Example Period over period variable page:
1 -
Thank you David & Thank you JedP.
Howevere what I am looking for is 3 filers ate top Month, Quarter & year and same way 3 cards on the page named MTD, QTD & YTD and the details should show as per attached.0 -
Interesting that so many suggest variables or parameters. I don't even think I'm using variables for anything.
I have posted examples previously with the way I do this. I create an ETL with aggregates that include fields for CY, PY, P2Y, etc. The same aggregate tiles include calculations for MTD, QTD, etc. For things like MTD or QTD, you just add more criteria for whether your date field is whatever quarter or month, or less than current month, etc.
CY:
sum(
case when YEAR(date
) = YEAR(CURRENT_DATE())
anddate
<= CURRENT_DATE()
thenamount
else 0 end
)
PY:
sum(
case when YEAR(date
) = YEAR(CURRENT_DATE())-1
anddate
<= DATE_ADD(CURRENT_DATE(),-365)
thenamount
else 0 end
)
or
sum(
case when YEAR(date
) = YEAR(DATE_ADD(CURRENT_DATE(),-365))
anddate
<= DATE_ADD(CURRENT_DATE(),-365)
thenamount
else 0 end
)** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1 -
I think you could do all of this with no BeastModes or Variables.
A variable would be useful if you were trying to do this all with one card, with the ability to switch the metric from MTD, QTD, YTD, but you want to use three different cards, so you can easily define the "graph by" on each card using the date options.
I also don't think you need three filters. Based on my reading of your PDF, all three filters you describe are basically saying the start date you want to be used. The simplest implementation would be a "range selector", card where users can adjust the date range to be displayed.
Also based on your PDF, it seems like you want to compare to the prior year. Use a period-over-period card, and you should be able to do that, as well as define whether it's a by-month, by-quarter or by-year card.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Thank you all but still this won't solve my problem :(
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 297 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 678 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive