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.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
- 600 Datasets
- 2.1K Magic ETL
- 3.7K Visualize
- 2.4K Charting
- 688 Beast Mode
- 43 App Studio
- 38 Variables
- 658 Automate
- 170 Apps
- 441 APIs & Domo Developer
- 42 Workflows
- 5 DomoAI
- 32 Predict
- 12 Jupyter Workspaces
- 20 R & Python Tiles
- 385 Distribute
- 110 Domo Everywhere
- 269 Scheduled Reports
- 6 Software Integrations
- 112 Manage
- 109 Governance & Security
- 8 Domo University
- 25 Product Releases
- Community Forums
- 39 Getting Started
- 29 Community Member Introductions
- 98 Community Announcements
- Domo Community Gallery
- 4.8K Archive