Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
vgadang1
Partner - Contributor III
Partner - Contributor III

retention calculation

I have a userID column, date, datemonth, monthnumber, session count, I am trying to create a KPI for total retained users that accessed app (session count) last month and also accessed this month. 

 

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

as below,  not sure what values your datemonth or date field has

I would prefer creating a field with just monthstart or monthend dates to simplify the expression

 

,monthstart(date) as monthstartdate

 

and expression as below

 

=count( {< userID={"=sum({<monthstartdate={"$(=MonthStart(Max(date)))"}>}sessioncount)>0 AND sum({<monthstartdate={"$(=MonthStart(Max(date),-1))"}>}sessioncount)>0"} >} Distinct userID)

 

This expression is basically filtering userID's with session count>0 in selected/max AND prior month

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

1 Reply
vinieme12
Champion III
Champion III

as below,  not sure what values your datemonth or date field has

I would prefer creating a field with just monthstart or monthend dates to simplify the expression

 

,monthstart(date) as monthstartdate

 

and expression as below

 

=count( {< userID={"=sum({<monthstartdate={"$(=MonthStart(Max(date)))"}>}sessioncount)>0 AND sum({<monthstartdate={"$(=MonthStart(Max(date),-1))"}>}sessioncount)>0"} >} Distinct userID)

 

This expression is basically filtering userID's with session count>0 in selected/max AND prior month

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.