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

Set analisys comparing with dates

hi!

I have a table with these columns:

Key

Field1

Field2

Date_from

Date_to

I want a grid that will show me only the record where Date_from < Date_to.

How can i do?

an expression such as this does not work:

=COUNT ({$ < Date_from <= Date_to >}Key)

in this way it work!

=COUNT(if(Date_from <= Date_to >, CHIAVE))

but i like the set analisys...

help me, please 🙂

1 Reply
ToniKautto
Employee
Employee

Notice that set expression is usewd to create a new subset of data to calculat the expression over, which means it will act more like a filtering of your data before the expression is calculated.

In this case you are looking for a way to compare to fields on the same row in your data. For this you can use a IF statement instead to check if your conditional requirement is fulfilled.

=Count( If( Date_from <= Date_to, Key) )

This menas that if the Date_to is greater or equal to the Date_from the value Key will be added in the Count() otherwise Null will be added, which means taht it will not be counted at all.