# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

## Count dates less than due dates.

Hi There

How to count dates from given list.

From the attached sheet , I am looking for following solution.

HOW MANY CUSTOMERS HAVE PAID OF THEIR LOAN EARLIER THAN EXPECTED

Thanks ,

1 Solution

Accepted Solutions
Contributor

## Re: Count dates less than due dates.

Something new i learnt,  Thanks sunny .

Correction in expression : Count(DISTINCT {<loan_status = {'PAIDOFF'}, loan_ID = {"=paid_off_time < due_date"}>} loan_ID)

And it Works.

14 Replies
MVP

## Re: Count dates less than due dates.

May be this

Count(DISTINCT {<loan_status = {'PAIDOFF'}, loan_ID = {"=Floor(paid_off_time) < due_date"}>} loan_ID)

Contributor II

## Re: Count dates less than due dates.

Not worked, its giving '0' as output.

MVP

## Re: Count dates less than due dates.

Are your dates and time stamps read as dual fields?

Contributor

## Re: Count dates less than due dates.

or may be this

a Flag at backend : If(paid_off_time<due_date,1,0) as Flag

and expression as : =Count(DISTINCT {<loan_status={'PAIDOFF'},Flag={1}>} loan_ID)

Regards,

Nitin G.

MVP

Contributor

## Re: Count dates less than due dates.

Hi sunny,

with due respect, I doubt in expression for the striked one would give desired result.

Count(DISTINCT {<loan_status = {'PAIDOFF'}, loan_ID = {"=Floor(paid_off_time) < due_date"}>} loan_ID)

Regards,

Nitin G.

MVP

Why not

Contributor

## Re: Count dates less than due dates.

because within set analysis for

loan_ID={"=Floor(paid_off_time)<due_date"}

in this loan_ID has different data type whereas paid_off_time and due date are of different type, which wont give desired result as per my understanding.

Regards,

Nitin G.

MVP

## Re: Count dates less than due dates.

Have you not used Search string in set analysis? May be read it here

Re: Why i am not getting same result with Above function ?