Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

guyvermeiren
Contributor

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
MVP
MVP

Re: If-statement with Dates

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

6 Replies
MVP
MVP

If-statement with Dates

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
Contributor

If-statement with Dates

Stefan,

No, it doesn't change a thing

Thanks anyway.

Guy

MVP
MVP

If-statement with Dates

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
Contributor

If-statement with Dates

Stefan,

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

Kind regards,

Guy

MVP
MVP

Re: If-statement with Dates

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
Contributor

Re: If-statement with Dates

Stefan,

Thanks, it works now

Kind regards,

Guy

Community Browser