Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor

How to calculate a customer retention volume?


I am having trouble to syntax something easy on paper. I hope someone will be able to help me out.

I am trying to calculate the gained, lost and retained customers volume between two periods.

If we take for example the gained customers, I am already able to figure out which customers have ordered some [Containers] during the current period where they did not ordered during the previous one thanks to the following formula:

COUNT(DISTINCT(aggr(if(SUM({$<[Date]=p([Current Date]), [Current Period]=>}[Containers]) > 0 and

SUM({$<[Date]=p([Previous Date]), [Previous Period]=>}[Containers]) <=0, Customer),Customer)))

I am actually struggling to create a front end formula that would give the number of containers "gained" for these specific customers that are matching the formula above.

Any help is welcome. Thanks