Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
May 18th 10AM ET, Live Chat, bring your QlikView questions. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
chinnukool
Contributor III
Contributor III

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)

View solution in original post