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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
mcorser
Contributor II
Contributor II

How to select data within a certain year, using user input?

I have a list of annual permit holders with a column indicating permit year. Each permit holder has an unique CustomerID that does not change from year to year (ie. customer 001 may have two records, one from 2019 and another from 2020, but with the same CustomerID). I want to have a user select a year, then see what percentage of permit holders renew their permits for the selected year. We'll call this "churn rate".

In the expression editor, how do I call the set of CustomerIDs for the selected year, and compare them to the set of CustomerIDs from the previous year?

Labels (1)
2 Replies
Digvijay_Singh

May be like this - 

Count({<Year={"$(=Max(Year))"}>}distinct [Customer ID])

Count({<Year={"$(=Max(Year)-1)"}>}distinct [Customer ID])

QFabian
MVP
MVP

Hi @mcorser . please try this :

demo data :

 

LOAD * INLINE [
CustomerId, Year
1, 2019
2, 2019
2, 2020
3, 2019
3, 2020
4, 2019
4, 2020
];

output expression :

count(CustomerId)
/
count({<Year = {"$(=Year-1)"}>} CustomerId)

 

 

demo output

QFabian_0-1648659818503.png

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.