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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
ivandrago
Creator II
Creator II

Set Analysis Date greater Today

Hi,

I have the attached document I am trying create an expression where it will count the PK field where the field DatePromised is greater than or equal than todays date, but the expression I have does not seem t be working?

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Alternatively, I think it would be better to create a date field (without the time component) in the script and use that for set analysis. Something like this:

Fact:

LOAD PK,

     DateEntered,

     DatePromised,

     Date(Floor(DatePromised)) as Date

     Qty,

     Area

FROM

C:\Qlikview\QVOrdersExample.xlsx

(ooxml, embedded labels, table is Sheet1);

and then your expression:

Count({$<Date={"$(='>=' & Date(Today()))"}>}PK)

View solution in original post

4 Replies
sunny_talwar

Try this expression:

Count({$<[DatePromised]={"=Date(Floor(DatePromised)) >= Today()"}>}PK)


Capture.PNG

sunny_talwar

Alternatively, I think it would be better to create a date field (without the time component) in the script and use that for set analysis. Something like this:

Fact:

LOAD PK,

     DateEntered,

     DatePromised,

     Date(Floor(DatePromised)) as Date

     Qty,

     Area

FROM

C:\Qlikview\QVOrdersExample.xlsx

(ooxml, embedded labels, table is Sheet1);

and then your expression:

Count({$<Date={"$(='>=' & Date(Today()))"}>}PK)

ivandrago
Creator II
Creator II
Author

Thanks Sunny, I was using the Date function i.e Date(DatePromised,'DD/MM/YYYY') but was not liking it.

sunny_talwar

Without Floor() you might format your date as DD/MM/YYYY, but it won't remove the time component. To remove time component from your TimeStamp Field you need to use Floor function.