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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with conditions on fields of date types

Hello,

I want to use the count function using a set analysis expression and with two conditions in it.

This is my expression:

= count({<ORDER_BOOKED_DATE>Today()-7, PROMISE_DATE<Today()+30>}LINE_NUMBER)

ORDER_BOOKED_DATE and PROMISE_DATE are fields of date type. So basically i want to count  orders that have been registered more than a week ago  and with a promised date less than a month.

This does not work. Is there something i'm doing wrong?

Help please!

Thanks.

Tatiana

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

try this expression:

=Count({<ORDER_BOOKED_DATE = {"$(='<' & Date(Today()-7, 'DD/MM/YYYY'))"}, PROMISED_DATE = {"$(='<' & Date(Today()+30, 'DD/MM/YYYY'))"}>}LINE_NUMBER)

View solution in original post

16 Replies
niclaz79
Partner - Creator III
Partner - Creator III

Hi Tatiana,

Try the following:

= count({<ORDER_BOOKED_DATE = {">$(=Today()-7)"}, PROMISE_DATE = {"<$(=Today()+30)"}>}LINE_NUMBER)

sunny_talwar

What is your date field format here? (for ORDER_BOOKED_DATE and PROMISE_DATE)?

Not applicable
Author

Hi Talwar,

The date format is: DD/MM/YYYY for both fields

Not applicable
Author

Hi Niclas,

I have tried this but it doesn't work. The count gives a result of 0

sunny_talwar

Try this

=Count({<ORDER_BOOKED_DATE = {"$(='>' & Date(Today()-7, 'DD/MM/YYYY'))"}, PROMISE_DATE {"$(='<' & Date(Today()+30, 'DD/MM/YYYY'))"}>}LINE_NUMBER)

Not applicable
Author

Still doesn't work.

It says there is an error into the set modifiers expression

prma7799
Master III
Master III

Please share some sample data.

sunny_talwar

My bad, missed an equal sign, try this

=Count({<ORDER_BOOKED_DATE = {"$(='>' & Date(Today()-7, 'DD/MM/YYYY'))"}, PROMISE_DATE = {"$(='<' & Date(Today()+30, 'DD/MM/YYYY'))"}>}LINE_NUMBER)

Not applicable
Author

I double checked and  it seems like the second condition (PROMISE_DATE={"$(='<' & Date(Today()+30, 'DD/MM/YYYY'))"}) does not applied in the expression.