Calculating Months Between Dates
Hello,
I am attempting to calculate the months between two dates as precisely as possible.
I don't want to just compare the months themselves, since that would make the consecutive dates of 4/30/18 and 5/1/18 (months 4 and 5) have 1 month passed.
I know this can be done roughly by calculating the days passed and dividing it by the average # of days in a month, but is there a more precise way to do this that compares once that same day (ex. the 10th) is reached or passed on a following month to signify the passing of a month?
Thanks
Comments
-
My suggestion would use the datediff feature then have that be divided by the number of days in the specific month you want to reference. So I would begin with a beastmode to assign each month how many days are in it.
(case when month= 4 then 30
when month =5 then 31
when month = 6 then 30 etc
then you could write a statement like datediff/month from beastmode and it should give you a more precise count on months that passed
I know that this wasnt the most precise answer but maybe it can start some other ideas
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.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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