Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
moh2_sid
Contributor
Contributor

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
Contributor III
Contributor III

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
Contributor
Author

Thank you for you reply. 

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