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

Till Yesterday Count.

Hi All ,

Can any one help me with YTD logic

I need to take count of ID's till yesterday .

My data is from 1st May , 2016

I need the count of all ID's till yesterday i.e from 1st May to 14-06-2016 .(day before current date) in set analysis.

1 Solution

Accepted Solutions
PrashantSangle

Hi,

then modify expression as per date format you have.

Try like

Sunny Expression

May be like this:

Count({<Date = {"$(='<=' & Date(Today() - 1, 'MM/DD/YYYY'))"}>} ID)

Or this for a distinct count:

Count(DISTINCT {<Date = {"$(='<=' & Date(Today() - 1, 'MM/DD/YYYY'))"}>} ID)


or in my expression

Count({<DateField={"<=$(=Date(Today()-1,'MM/DD/YYYY'))"}>}Distinct id)


Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

17 Replies
sunny_talwar

May be like this:

Count({<Date = {"$(='<=' & Date(Today() - 1, 'DD-MM-YYYY'))"}>} ID)

Or this for a distinct count:

Count(DISTINCT {<Date = {"$(='<=' & Date(Today() - 1, 'DD-MM-YYYY'))"}>} ID)

PrashantSangle

hi,

or may be

count({<DateField={"$(<=Date(Today()-1))"}>}Distinct id)

careful with date format while comparing.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

You mean this max?

Count({<DateField={"<=$(=Date(Today()-1))"}>}Distinct id)

PrashantSangle

yes..

my bad.

thanks for correcting.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi Sunny,

I tried your solution but, nothing is coming.

Let me explain you again my requirement :

I have my data from 1st May 2016. I want count of all ID's from 1st May till yesterday i.e 14th June 2016.

Reply ASAP..!!

Thanks,

Ashvita

sunny_talwar

What is your date field format? Can you share screenshots or a sample qvw to look at?

Not applicable
Author

Hi Sunny,

My Date format is 'MM/DD/YYYY'.

Thanks,

Ashvita.

PrashantSangle

Hi,

then modify expression as per date format you have.

Try like

Sunny Expression

May be like this:

Count({<Date = {"$(='<=' & Date(Today() - 1, 'MM/DD/YYYY'))"}>} ID)

Or this for a distinct count:

Count(DISTINCT {<Date = {"$(='<=' & Date(Today() - 1, 'MM/DD/YYYY'))"}>} ID)


or in my expression

Count({<DateField={"<=$(=Date(Today()-1,'MM/DD/YYYY'))"}>}Distinct id)


Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi All,

Thanks Sunny and Max Dreamer for solution.

Its Working..

Warm Regards,

Ashvita.