Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
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.

Labels (1)
1 Solution

Accepted Solutions
PrashantSangle
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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
MVP
MVP

You mean this max?

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

PrashantSangle
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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.