Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Fetch the count of records created prior to the selected date

Hi All

We have a requirement where we need to take the count of all those records which are having the creation date less than the selected Day,month,year.

User will be choosing the Year first , then month followed by the Day.

And the creation date will be in DD/MM/YYYY format.

Please let me know how this can be acheived.

Regards

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

use the makedate function and compare this to the creation date, count then the records (eventually add a new column to the table with value =1 and count this column)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Lets assume for this explanation that the year, month and day are in variables vYear, vMonth and vDay and the creation date is the field CreationDate. Let's also assume that each row has a unique ID field called RowID and that the default date format is DD/MM/YYYY.

Then you could use:

Count({<CreationDate = {"<$(=MakeDate(vYear, vMonth, vDay))"}>} RowID)

If the default date format is not DD/MM/YYYY, then you will need:

Count({<CreationDate = {"<$(=Date(MakeDate(vYear, vMonth, vDay), 'DD/MM/YYYY'))"}>} RowID)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks Jonathan and Alexandros for the reply.

It worked

Regards

Bhupesh

Not applicable
Author

Thanks Jonathan and Alexandros for the reply.

It worked

Regards

Bhupesh