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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ranjitalenka
Contributor
Contributor

Qlik sense Code for KPI previous month

Hi,

 

I have the code for KPI percentage as below:

count({<[CSAT]={'Excellent', 'Very Good', 'Good', 'Poor', 'Very Poor'}>} Number1)/count(Ticket_Number)

 

what will be the code for previous month.

I used the below code ,but getting error

count({<[CSAT]={'Excellent', 'Very Good', 'Good', 'Poor', 'Very Poor'}>},[#Call Month],[#Call Year],[#CallDate],[#Call MonthSerial]={"$(=MAX([#Call MonthSerial])-1)"}>} Number1)/count({<[#Call Month],[#Call Year],[#CallDate],[#Call MonthSerial]={"$(=MAX([#Call MonthSerial])-1)"} >}Ticket_Number)

Labels (1)
1 Reply
edwin
Master II
Master II

there are a couple of ways to do this.  

assuming that you allow the user to select the month:

1. save the selected month in a variable, compute for the prior month in another variable.  then use these two variables in your set analysis

2. search for the AS OF TABLE this will be a mod to your data model such that when the user selects a month, you can use another field to point to the current month or prior month and use that field in your set analysis.  the advantage of this is you delegated the calculation to your data model which will be more efficient for large data sets