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.4K Product Ideas
- 1.4K Ideas Exchange
- 1.4K Connect
- 1.2K Connectors
- 284 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.9K Transform
- 88 SQL DataFlows
- 554 Datasets
- 2.2K Magic ETL
- 3.3K Visualize
- 2.3K Charting
- 561 Beast Mode
- 8 App Studio
- 27 Variables
- 577 Automate
- 140 Apps
- 414 APIs & Domo Developer
- 22 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 350 Distribute
- 90 Domo Everywhere
- 258 Scheduled Reports
- 2 Software Integrations
- 91 Manage
- 88 Governance & Security
- 9 Product Release Questions
- Community Forums
- 41 Getting Started
- 27 Community Member Introductions
- 85 Community Announcements
- 4.8K Archive