Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
guyvermeiren
Creator
Creator

If-statement with Dates

Hello,

I'm working with 2 dates. If I add a Calculated dimension like

[SalesDocumentConfirmedScheduleLine.Delivery date]-Today() I get a perfect result in days

Now I would like to eliminate a number of records by "Suppress when Value is Null" and as expression

If([SalesDocumentConfirmedScheduleLine.Delivery date]-Today() > 0, Null())

but this doesn't -seem to work.

For alle values I get a Null()

Any suggestions ?

Thanks in advance.

Kind regards,
Guy

1 Solution

Accepted Solutions
swuehl
MVP
MVP

So I probably misunderstood your problem.

The above given expression is returning correct values, limited to future dates, in my setting. Please see attached.

Regards,

Stefan

View solution in original post

6 Replies
swuehl
MVP
MVP

I think your expression misses the THEN part, NULL() should be the ELSE part, right?

Like:

If([SalesDocumentConfirmedScheduleLine.Delivery date]-Today() > 0, [SalesDocumentConfirmedScheduleLine.Delivery date]-Today(), Null())

Hope this helps,

Stefan

guyvermeiren
Creator
Creator
Author

Stefan,

No, it doesn't change a thing

Thanks anyway.

Guy

swuehl
MVP
MVP

Hm, should work given that at least some of your [SalesDocumentConfirmedScheduleLine.Delivery date]

values are Dates in the future (otherwise subtracting today will always be negative))

guyvermeiren
Creator
Creator
Author

Stefan,

Correct, some dates are in the future and the standard calculation works as I already said in the first mail.

Kind regards,

Guy

swuehl
MVP
MVP

So I probably misunderstood your problem.

The above given expression is returning correct values, limited to future dates, in my setting. Please see attached.

Regards,

Stefan

guyvermeiren
Creator
Creator
Author

Stefan,

Thanks, it works now

Kind regards,

Guy