Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with date SET analysis - previous month

Hi,

I need some help, and this has probably been asked a million times before, I just cant get it to work. I need to write a SET analysis for the previous months value count, however I want to use a date range and avoid using variables:

Count({$<Lead_Created_date={">=$(=addmonths(monthstart(max(Lead_Created_date)),-1))<=$(=addmonths(monthend(max(Lead_Created_date)),-1))"},OutcomeName={'Not interested'}>}Reference)

This doesnt return a value, however im sure the code is correct, the issue probably is that Lead_Created_date is a datetime field. Not sure if there is a way to solve this, can anyone help plz?

Thanks in advance.

Regards,

Ridwaan

1 Reply
sunny_talwar

Check here:

Dates in Set Analysis

One of the issue I can think is that Lead_Created_date might have a different date field format causing format mis-match which would lead to non-desired results. Try this:

Count({$<Lead_Created_date={">=$(=Date(MonthStart(Max(Lead_Created_date), -1), 'DateFieldFormatHere'))<=$(=Date(MonthEnd(Max(Lead_Created_date),-1), 'DateFieldFormatHere'))"}, OutcomeName={'Not interested'}>} Reference)