Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

guy_hombleu
New Contributor III

Count active customers between 2 dates

Hello,

I'm trying to count the number of active customers between 2 dates to create an analysis about campagin results. In these analysis we're compairing the facts with last year, that's why im using 2 dates.

   

CustomerDate
A5-5-2016
B5-5-2016
C6-5-2016
D7-5-2016
E8-5-2016
F9-5-2016
G10-5-2016
H11-5-2016
A5-5-2017
B6-5-2017
I7-5-2017
J8-5-2017
K9-5-2017
L10-5-2017

So im trying to figure out the following calculation:

=count ({$<Date = {">=Campaigndate<=30-05-2016"}>} DISTINCT Customer)


The campagindate is for example 06-05-2016.

But it seems like the enddate '30-05-2016' doesnt work.

Does anyove have an idea how to solve this one?

Thnx!

Tags (1)
1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Count active customers between 2 dates

Hi Guy,

try this if campaigndate is a Field

=count ({$<Date = {">=$(=Max(Campaigndate))<=30-05-2016"}>} DISTINCT Customer)

or this if campaigndate is a Variable

=count ({$<Date = {">=$(Campaigndate)<=30-05-2016"}>} DISTINCT Customer)

Regards,

Antonio


4 Replies
niclaz79
Contributor III

Re: Count active customers between 2 dates

Hi,

Try this:

=count ({$<Date = {">=Campaigndate<=$(=Date(30-05-2016))"}>} DISTINCT Customer)

guy_hombleu
New Contributor III

Re: Count active customers between 2 dates

Hi Niclas,

Thnx for your reply, I've just tried this but the results of the calculation is 0.

So it seems like it isn't working...

Do youve another idea?

antoniotiman
Honored Contributor III

Re: Count active customers between 2 dates

Hi Guy,

try this if campaigndate is a Field

=count ({$<Date = {">=$(=Max(Campaigndate))<=30-05-2016"}>} DISTINCT Customer)

or this if campaigndate is a Variable

=count ({$<Date = {">=$(Campaigndate)<=30-05-2016"}>} DISTINCT Customer)

Regards,

Antonio


vasiliy_beshent
Contributor III

Re: Count active customers between 2 dates

Try to make like in this app