Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have 3 fields those are Month, year, period
now i am having the data like this
month year period
03 2018 07/2017
03 2018 09/2017
Now i want to calculate the difference between month year and period how to calculate the difference ?
Thanks in advance
There is no Measure in your Table? Will you able to share sample
NO measure in the table i want to calculate the difference months b/w the period and month year,
Try
MakeDate(Year,MOnth,1)-date#(period,'MM/YYYY'),
Perhaps this?
Date(MonthName(month&year), 'MM/YYYY') - Date(period,'MM/YYYY')
what is the difference you would expect given your sample data?
This should give you the difference number of months:
((year-1) - right(period, 4))*12 + (month + 12 ) - Left(period, 2)
Try this it works
load *,
Date(Date#(MonthYear,'MM/YYYY'),'MM/YYYY')-Date(Date#(period,'MM/YYYY'),'MM/YYYY') as Difference;
load *,
month&'/'&year as MonthYear Inline [
month,year,period
03,2018,07/2017
03,2018,09/2017
];
Hey Vishal,
Nice Explanation.
This one correct.