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

Announcements
Week 2: Presenting "Automate Sucess" and "Integration for Innovation" - WATCH NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Modiz
Contributor III
Contributor III

count number fo date from variable

Hi,

I have a variable like this:

v.excludeddate ='2024-01-01';'2024-09-01','2024-09-28','2024-10-05';

 

I need to count the distinct dates from this variable between the start of the current month and the end of the current month using a set expression. 

 

when i use count distinct I get 1.

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You can do like this, without using set expression with SubStringCount()

=SubStringCount( v.excludeddate, date(today(), 'YYYY-MM'))

Vegar_0-1726831550243.png

As shown in the image above. The number of september dates in the variable is 2. 

 

View solution in original post

3 Replies
avinashelite

As per my knowledge at the variable level , I don't think its possible ...you could count the number of dates using the substringcount function and using the delimiter as the string to count 

Vegar
MVP
MVP

You can do like this, without using set expression with SubStringCount()

=SubStringCount( v.excludeddate, date(today(), 'YYYY-MM'))

Vegar_0-1726831550243.png

As shown in the image above. The number of september dates in the variable is 2. 

 

Modiz
Contributor III
Contributor III
Author

Thank you!