Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set analysis to calculate last month's value

Hi,

I have below user counts and I'm trying to display these in 2 separate text boxes, one for current month and the other one to show last month's value.

Current Month = 4

Last Month = 23

Current Month

=count({<DATE ={">=$(=Date(monthstart(Max(DATE)),'MM-DD-YYYY'))"}>} distinct USERID)

Result = 4

Last Month

=count({<DATE ={">=$(=Date(AddMonths(monthstart(Max(DATE)),-1),'MM-DD-YYYY')) < $(=Date(monthstart(Max(DATE)),'MM-DD-YYYY'))"}>}distinct USERID)

Result = 27 (above expression is doing 23+4)

Can someone please help me calculate last month's data right as 23?

Thanks!

1 Solution

Accepted Solutions
sunny_talwar

May be remove the spaces around '<'

=Count({<DATE = {">=$(=Date(AddMonths(MonthStart(Max(DATE)),-1),'MM-DD-YYYY'))<$(=Date(MonthStart(Max(DATE)), 'MM-DD-YYYY'))"}>} DISTINCT USERID)

View solution in original post

1 Reply
sunny_talwar

May be remove the spaces around '<'

=Count({<DATE = {">=$(=Date(AddMonths(MonthStart(Max(DATE)),-1),'MM-DD-YYYY'))<$(=Date(MonthStart(Max(DATE)), 'MM-DD-YYYY'))"}>} DISTINCT USERID)