Forum Discussion
Need help with some Dates math
Hi AndresSalomon,
How to get the date column indicates to Asset allocation? What's the rules of calculation. And you said, "for example, for Asset #1, the Start Date should be 11/01/2017. For Asset #2, 09/15/2017". How did you get the 2017/11/01 and 2017/09/15?
Best Regards,
Angelia
Hi Angelia, thanks for replying and follow up with this problem.
Regarding your question about the "Start Date" column of the Asset, first take a look at the table I have:
Asset ID_____________Allocation___________Month____________Overdue date__________START DATE
1_______________________0___________________Sep______________10/27/2017____________11/01/2017
1_______________________0___________________Oct______________10/27/2017____________11/01/2017
1_______________________1.1_________________Nov______________10/27/2017____________11/01/2017
1_______________________1.08________________Dec______________10/27/2017____________11/01/2017
...
2_______________________0.5_________________Sep______________11/28/2017____________09/15/2017
2_______________________1___________________Oct______________11/28/2017____________09/15/2017
2_______________________1.2_________________Nov______________11/28/2017____________09/15/2017
2_______________________1___________________Dec______________11/28/2017____________09/15/2017
So, that Start Date column in bold there, is the one I need to obtain.
Why? Because with that column I can compare with the Overdue Date column and check if the Asset is OK or Wrong (as the golden rule I posted in my first comment).
How should we obtain it? The Start Date of the Asset is the first month that the Asset has an Allocation and it depends on the Asset allocation; if it is close to 1, the Start Date should be the first day of the month and, if it is close to 0.5 the Start date should be mid month, like 15th.
This is how I'm obtaining the Start Date for Asset 1 and 2. Just check this analysis.
*Asset 1 doesn't have allocation in Sep or Oct, but it has 1.1 in Nov. The allocation is close to 1 and the first month it has is in Nov, so the Start Date is 11/01/2017 (same year of course).
*Asset 2 has 0.5 allocation in Sep. The allocation is close to 0.5 (in fact it is 0.5) and the first month it has is in Sep, so the Start Date is 09/15/2017 (same year of course).
How to achieve this? I have no idea.
I first think in creating an auxiliar Date column based on the Month date column (let say that if it is "Sep" we put 09/30/2017, if it "Oct" we put 10/31/2017, an so on, adding all the days the month has, with a SWITCH maybe), so we can start working with Dates only. Then with that auxiliar Date column we have to check the first month it has allocation as I explain above and create the Start Date column.
But it is just an idea. Maybe there is an easier way to do it.
Hope this clarify my request. Please let me know. Still withouth a solution. Thanks in advance!
Kind regards,
Andy.-
- v-huizhn-msft8 years agoMicrosoft Employee
Hi AndresSalomon,
I think you get solution in this case, right? Please review it.
Best Regards,
Angelia - Ashish_Mathur8 years agoSuper User