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: 
qlikviewalex
Contributor III
Contributor III

if condition in diagram

Hello,

in my diagram I use a formula:

=Count(if(Date#(endDate)=Date#(myDate), [Object-ID]))

This formula works.

Now I change my formula with <=:

=Count(   if(  Date#(endDate) <= Date#(myDate)   , [Object-ID]))

This formula doesn't works. Why?

My goal is a formula such as:

=Count(  if(  Date#(endDate)<=Date#(myDate)     and  Date#(startDate)>=Date#(myDate)   ,  [Object-ID]))

I hope someone can help me.

Alex

1 Solution

Accepted Solutions
sunny_talwar

Have you tried just this?

=Count(If(endDate <= myDate, [Object-ID]))

View solution in original post

6 Replies
Not applicable

I think it might be because Date#() function returns text instead of number, so Qlikview doesnt do < > calculation with it. Instead of Date#(), you may want to try Date().

tresesco
MVP
MVP

Date format. Yes that could be the reason. Could you post a sample qvw that demonstrates the issue?

qliksus
Specialist II
Specialist II

As said by tresesce data format could be a issue  change it to maybe something like this

=Count(   if(  Date(Date#(endDate,'MM/DD/YYYY'),'MM/DD/YYYY') <= Date(Date#(myDate,'MM/DD/YYYY'),'MM/DD/YYYY')   , [Object-ID]))

sunny_talwar

Have you tried just this?

=Count(If(endDate <= myDate, [Object-ID]))

qlikviewalex
Contributor III
Contributor III
Author

it was too easy

qlikviewalex
Contributor III
Contributor III
Author

Thanks