13 Replies Latest reply: Mar 1, 2016 6:59 AM by Tresesco B

# Previous month last date

Dear All,

i want to add Previous month Last day sales and want to compare from current month Last day sales.

For example today is 29-2-2016 i want to extract  31-1-2016 date as well as sales of that date.

i have two fields one for 'Date' and other is 'Sales', i hope its clear now

• ###### Re: Previous month last date

Hi,

You can use the Function as below.

Regards,

Kaushik Solanki

• ###### Re: Previous month last date

Bit simpler:

=Sum({<Date ={"\$(=Monthend(Max(Date),-1))"}>}Sales)

• ###### Re: Previous month last date

sum({\$ <Date={"\$(=monthend(today()))"}>} Sales)

sum({\$ <Date={"\$(=date(monthstart(today())-1))"}>} Sales)

• ###### Re: Previous month last date

both formulas giving me zero i do not know y but it is giving me zero.

Sales is my field as well as date field.here is my data if you could help me.

 Region Date Sales South 1-Jan-16 10 Central 2-Jan-16 11 North 3-Jan-16 12 South 4-Jan-16 13 Central 5-Jan-16 14 North 6-Jan-16 15 South 7-Jan-16 16 Central 8-Jan-16 17 North 9-Jan-16 18 South 10-Jan-16 19 Central 11-Jan-16 20 North 12-Jan-16 21 South 13-Jan-16 22 Central 14-Jan-16 23 North 15-Jan-16 24 South 16-Jan-16 25 Central 17-Jan-16 26 North 18-Jan-16 27 South 19-Jan-16 28 Central 20-Jan-16 29 North 21-Jan-16 30 South 22-Jan-16 31 Central 23-Jan-16 32 North 24-Jan-16 33 South 25-Jan-16 34 Central 26-Jan-16 35 North 27-Jan-16 36 South 28-Jan-16 37 Central 29-Jan-16 38 North 30-Jan-16 39 South 31-Jan-16 40 Central 1-Feb-16 60 North 2-Feb-16 150 South 3-Feb-16 240 Central 4-Feb-16 330 North 5-Feb-16 420 South 6-Feb-16 510 Central 7-Feb-16 600 North 8-Feb-16 690 South 9-Feb-16 780 Central 10-Feb-16 870 North 11-Feb-16 960 South 12-Feb-16 1050 Central 13-Feb-16 1140 North 14-Feb-16 1230 South 15-Feb-16 1320
• ###### Re: Previous month last date

What is your expected output?

• ###### Re: Previous month last date

my desired result to get

first expression

 South 31-Jan-16 40

second expression

 South 15-Feb-16 1320

i want these numbers as result in table form.

• ###### Re: Previous month last date

Did you try what I suggested you?

To get 15-Feb-16, just remove monthend() from my Current Month Expression

• ###### Re: Previous month last date

PFA

=Sum({<Date ={"\$(=Date(Max(Date)))"}>}Sales)

=Sum({<Date ={"\$(=Monthend(Max(Date),-1))"}>}Sales)

• ###### Re: Previous month last date

See the attachment,

Hope this will help!!

• ###### Re: Previous month last date

PFA

• ###### Re: Previous month last date

Hi,

Try like this

Current Month MaxDate:

Sum({<Year=, Quarter=, Month=, Date={"\$(=Date(MonthEnd(Today())))"}>} Sales)

Previous Month MaxDate:

sum({<Year=, Quarter=, Month=, Date={"\$(=Date(MonthEnd(Today(),-1)))"}>} Sales)

Hope this helps you.

Regards,

Jagan.

• ###### Re: Previous month last date

Simply use :

MonthEnd(Date) to get last date of every month

• ###### Re: Previous month last date

It's good practice to mark helpful/correct replies - that helps others searching for similar solution.