Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
moh2_sid
Contributor II
Contributor II

Id Count for Current Month vs Prev Month (Data Captured - weekly)

Hi All, 

Hope All is well! 

I am new to using Qlik and need of help of the experts. I have a data set which gets updated weekly (Date -field) to capture Status of Apps, I am trying to build an KPI for Count of ID's - Curr vs Prev Month  

I need help with the set analysis expression to capture ID's for Max Date of Last Month where status is 'No'. I tried to used "max(ADDMONTHS(Date,-1))' in my set analysis as below

(COUNT({<Date = {"max(ADDMONTHS(Date,-1))"}>}ID)).

but its considering 'JUL-02-24' , based on the max date of current month (08/02/24). Instead I want it to consider ''07-26-24", as it is max date for last month in my data set.  Eg of the Data set in the below picture.

moh2_sid_1-1723412708003.png


@krishna_2644 @rubenmarin 

Hoping to get the solution from the experts.

Thanks for your help. 

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

@moh2_sid  try below

count({<Date = {'$(=date(max({<Date={">=$(=monthstart(addmonths(max(Date),-1)))<=$(=monthend(addmonths(max(Date),-1)))"}>}Date)))'}>}ID)

View solution in original post

3 Replies
Padma123
Creator
Creator

use

(COUNT({<Date = {"$(=addmonths(max(date),-1)))"}>}ID))

 

 

Kushal_Chawda

@moh2_sid  try below

count({<Date = {'$(=date(max({<Date={">=$(=monthstart(addmonths(max(Date),-1)))<=$(=monthend(addmonths(max(Date),-1)))"}>}Date)))'}>}ID)

moh2_sid
Contributor II
Contributor II
Author

Thank you for you reply. 

But It's still considering JUL-02-24 as date.