Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have a field YearMonth which has values like 201507, 201506, 201505 ..201501.
I want to create an other field like PreviousYearMonth which should display 201506,201505,201504....201412 .ie previous month data for YearMomth.
I am facing issue to handle January month . Like if I select January , for eg 201501. It should give 201412.
Kindly help me with this issue.
Thanks in advance..
=date(addmonths(Date#('201501','YYYYMM'),-1),'YYYYMM')
For this sort of analysis, I create a MonthIndex field in my master calendar:
Year * 12 + Month As MonthIndex,
Now for the set analysis:
=Sum({<MonthIndex = {"$(=Max(MonthIndex) - 1)"}>} Sales)
But you will probably be making selections on fields Year, Month. You will need to ignore these selections:
=Sum({<MonthIndex = {"$(=Max(MonthIndex) - 1)"}, Year=, Month=>} Sales)
Thanks Clever Anjos and Jonathan Dienst .
I will try above solutions provided by you and gert back on this.
Format the dates as per your need and use inter-record function previous()
Hello Clever
This seems to be particularly for the month of Jan, I need a generic expression which will take care for all other months including January.
However i will try to work on above expression.
Hello Clever
It is working fine..!! Thanks
Instead 201501 could be any month, it was just an example
=date(addmonths(Date#('201501','YYYYMM'),-1),'YYYYMM')
Exactly!!
Hello Chintan,
Hope this will help you out.
Main:
Load *,Date(AddMonths(Date#(Dates,'YYYYMM'),-1),'YYYYMM');
load * Inline [
Dates
201507,
201506,
201505
];
Thank you