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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count between string dates

Good day.

i am hoping that someone could help in this regard.

i have created a variable to create a custom financial start and end date as per our company financial start and end dates.

i now need to count the number of public holidays in my public holiday table between our financial start date and end dates. i cannot seem to get the correct counts from my expression. I am not sure if it is a problem with the way i have created my variables, please could someone assist.

Expression for Variables.


Start

=DATE#('01/07/' & (MaxFinYear-1),'DD/MM/YYYY')

End

=DATE#('30/06/' & (MaxFinYear),'DD/MM/YYYY')


When i place the variables into a label i get the correct dates and formats. But when i try and use the variables in the count, i get 0.

Expression for Count:


=count({<PublicHoliday={'>=$(zFinYearStart)<=$(zFinYearEnd)'}>} PublicHoliday)



i have also tried converting date to Num but then i get the full count of all public holidays in my table.

=count({<PublicHoliday={'>=$(Num(zFinYearStart))<=$(Num(zFinYearEnd))'}>} PublicHoliday)

any assistance would be appreciated.



1 Solution

Accepted Solutions
tresesco
MVP
MVP

Is your PublicHoliday field  string or  proper date? How does it look in the list box?

View solution in original post

2 Replies
tresesco
MVP
MVP

Is your PublicHoliday field  string or  proper date? How does it look in the list box?

Not applicable
Author

Ahhh...Thank you so much Tresesco B.

i changed my date format to match my public holiday format and it now works.

sorry about that, i am still very new to Qlickview.

thank you for taking time to help.