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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trying to get the count.

I have data as below...

ID  DateEnd

1  

2

3   10/31/2016.

Trying to get the count of ID's which has Date > today () and I am using the below expression,

count(if(date([DateEnd] >Today() ),[ID]))  but  it is not working

THnaks much

1 Solution

Accepted Solutions
sunny_talwar

How about this:

LOAD ID,

          Date(Date#(DateEnd, 'MM/DD/YYYY')) as DateEnd

FROM....

Count({<DateEnd = {"$(='>' & Date(Today()))"}>} ID)

View solution in original post

11 Replies
Digvijay_Singh

Looks like you misplaced one bracket,

count(if(date([DateEnd]) >Today(),[ID]))

swuehl
MVP
MVP

Try

count(if( [DateEnd] >Today() , [ID]))

Not applicable
Author

Tried that...but no luck

swuehl
MVP
MVP

Are your dates correctly intepreted by QV?

Why don’t my dates work?

Not applicable
Author

yeah...when I put in listbox it is in the following format....10/31/2016

sunny_talwar

How about this:

LOAD ID,

          Date(Date#(DateEnd, 'MM/DD/YYYY')) as DateEnd

FROM....

Count({<DateEnd = {"$(='>' & Date(Today()))"}>} ID)

Anil_Babu_Samineni

Try like this using set expression

count({<[DateEnd] = {'=$(=>Today())'} >} ID)


Or script level


Load id, dateend where dateend => today();

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vishsaggi
Champion III
Champion III

It worked fine with this: Is your data coming from somewhere or just trying on some test data as mentioned below.

And hope there is no additional characters beside date like [10/31/2016.]

LOAD * INLINE [

ID,  DateEnd

1, 

2,

3,   10/31/2016

];

Textbox: I used stefan expression  = count(if( [DateEnd] >Today() , [ID]))

It displays 1.

Not applicable
Author

Here comes my herroooo