Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guyys, i want to Find Out Previous Month Method. Suppose I have a One Year 2015 and 2014.. In that I want to
Compare the sum of sales month wise.. Like If I select 2015 as a Year and dec as a Month. so i get the Sum of sales
for Dec and Nov . as well if i select Year 2015 and Month Jan i get the sum of sales for Jan and Dec2014..
Kindly Help me ..
Hi,
Like this???
Thanks,
AS
hi Amit..
This is not i want.. I want only on Month Basis.. JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC ..
say i have a List Box for Month.. if i select MAR...I GET Value for MAR And FEB
Hi,
Try this:
=Date(MonthStart(Max(DateField), -1), 'MMM')
Thanks,
AS
Hi,
Try below expression, hope this will solve your issue
=Date((Datefield)-1,'MMM-YY')
The simplest way to perform this sort of analysis is to have a month sequence number in the master calendar
Calendar:
LOAD ....
Date,
Year(Date) As Year,
Month(Date) As Month,
Year(Date) * 12 + Month(Date) As MonthSeq,
...
Now you can use the expressions for selected month and the previous month:
Sum({<MonthSeq = {"$(=Max(MonthSeq))"}>} Sales)
Sum({<MonthSeq = {"$(=Max(MonthSeq) - 1)"}>} Sales)
You may need to override selections of Month and Year....
Sum({<MonthSeq = {"$(=Max(MonthSeq))"}, Month, Year>} Sales)
Sum({<MonthSeq = {"$(=Max(MonthSeq) - 1)"}, Month, Year>} Sales)
See
Understanding the Master Calendar (video)
Calculating rolling n-period totals, averages or other aggregations
Thanks Amit,
Its Working Fine.. But When i select JAN2015 its Shows the Value for DEC2015.. Can we show DEC2015 Value..
Thanks Once Again
PFA. Hope it is you are looking for.
You need to have date field also. Create it if does not exist in model.
In Script add , Date(makedate(Year,month),'MMYYYY') as Date.
then
Sum({<Date= {'<=$(=max(Date))>=$(=Date(addmonths(Date,-1),'MMYYYY'))'}>}Sales).
i m trying this Way for Previous Month..
=if(Month= 'Jan',sum({<Month = {$(vPreviousMonth)}, Year =(Max(Year)-1)>}Price_Pcs_Incl_Discount),sum({<Month = {$(vPreviousMonth)}>}Price_Pcs_Incl_Discount)).. its not showing any thing..