Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
tresesco
MVP
MVP

Try like:

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

View solution in original post

9 Replies
tresesco
MVP
MVP

Try like:

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

Anil_Babu_Samineni

May be create 2 variables like

LET Start = Today()-7

LET End = Today()+30

Then create like below

= count({<ORDER_BOOKED_DATE = {">$(Start)"}, PROMISE_DATE={">$(End)"} LINE_NUMBER)

Or

Simply change your expression to this?

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Kushal_Chawda

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

Anil_Babu_Samineni

Mae sure to play around with date format if you have not set up like DD-MM-YYYY for Order and Promise

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ahaahaaha
Partner - Master
Partner - Master

Hi Tatiana,

Try

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


Andrey

Not applicable
Author

Hi Anil,

I have already set up the Order and the promise day to the date format. I tried your expression but the count is 0 which is not normal

Not applicable
Author

Thank you guys for the help!

Not applicable
Author

Thank you Anil it works fine

Not applicable
Author

thank you it works!