Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
da_pagnott
Contributor III
Contributor III

Using Count function between two dates

Hi guys,

I'm working with count function and date values, and I need to count the number of items between two days (let's say between 01/01 and yesterday).

DocDta it's a date value, correctly recognized as date.

DocNum it's an ID.

YTDStart it's a date (01/01/2019).

YTD it's a date (yesterday).

I tried this function but it doesn't work (I want to count values greater than start and less than yesterday).

The followind fuction doesn't make any filter so I get the count of all my values.

=Count({<DocDta={">=$(=YTDStart)"},DocDta={"<=$(=YTD)"}>} DocNum)

However, if I remove the secondo condition and I count just values greater that 01/01 I correctly get the right value.

=Count({<DocDta={">=$(=YTDStart)"}>} DocNum)

Do you have any idea about that?

 

Thank you!

Labels (2)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

Modify your expression like below and try

 

=Count({<DocDta={">=$(=YTDStart) <=$(=YTD)"}>} DocNum)

i am assuming the formatting is the same in YTDstart and YTD

View solution in original post

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

Modify your expression like below and try

 

=Count({<DocDta={">=$(=YTDStart) <=$(=YTD)"}>} DocNum)

i am assuming the formatting is the same in YTDstart and YTD

da_pagnott
Contributor III
Contributor III
Author

Nice, it works!

Thank you for your help!!

dplr-rn
Partner - Master III
Partner - Master III

no problems