Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
narender123
Specialist
Specialist

Current Vs Previous month amount

Hi,

I want to calculate this month and previous month amount.If i select march then it should show  mar vs feb amount in straight table and by default when there is no selection it should show only Current month Vs previous month amount .

Thanks in advance.

7 Replies
Anonymous
Not applicable

Hi,

Please check with below exp.

for the current month: (Sum({<[Data Feed Month]={"$(=date(AddMonths([Data Feed Month],0),'MMM YYYY'))"}>} [Charge Rate]))

PrevMonth: Sum({1<SelDate={"$(=date(AddMonths(SelDate,-1),'MMM YYYY'))"}>} DollarAmount)

Thanks

Arun M

nilesh_gangurde
Partner - Specialist
Partner - Specialist

Hii narender,

For Current Month :

SUM({<MonthField = {"$(=Max(MonthField))"}>}Amount)

For Prev Month:

SUM({<MonthField = {"$(=Month(floor(AddMonths(Max(MonthField),-1))))"}>}Amount)

-Nilesh

er_mohit
Master II
Master II

Try this

sum({<Date = {">=$(=MonthStart(Max(Date), -2))<=$(=MonthEnd(Max(Date), -1))"},Year=,Month=>}Amount)

see the attached file

narender123
Specialist
Specialist
Author

Hi all,

Its not working.

Could you give me the solution with example(qvw).

Thanks.

narender123
Specialist
Specialist
Author

Hello Guys,

Anybody give me the idea??

Not applicable

Hi,

if(InMonthToDate(Date,Today(),0,4),1,0) as CMTD/* date which falls under current month*/,
if(InMonthToDate(Date,addmonths(Today(),-1),0,4),1,0) as LMTD/* date which falls under Last month*/

the above expressions will give you 1 and 0-whichever falls under 1 comes into that month

For the current month sales :

=sum({<CMTD={'1'}>} Amount)/*will give you the current month amount*/

=sum({<LMTD={'1}>} Amount)/* will give you the last month amount*/

narender123
Specialist
Specialist
Author

current month

=SUM({<Year={$(=Max(Year))},Month = {$(=Maxstring(Month))}>}Value)

previous month

=SUM({<Year={$(=max(Year))},Month = {$(=Month(floor(AddMonths(Today(),-1))))}>}Value)

Its working now.

Thanks to all.

Narender