Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sculptorlv
Contributor II

Date comparing

Please help! Can't get the right logic to compare dates.

I have variable DateX (the start date of the contract)

I have today date Today()

How can I get the answer,

   if 3 months is passed from the DateX date?

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Date comparing

If( AddMonths(DateX, 3) < Today(), '3 months passed' , 'Not yet')

4 Replies
MVP
MVP

Re: Date comparing

If( AddMonths(DateX, 3) < Today(), '3 months passed' , 'Not yet')

sculptorlv
Contributor II

Re: Date comparing

Thank you. This works.

I used the same logic .. but made mistake in another expression .. thus was looking for another solution.

Thank you once again.

berndjaegle
Contributor

Re: Date comparing

Be aware, that AddMonths() will not cut the time Information from your DateX. Today() on the other hand has time 00:00:00. In my case I had to floor my date.

date(floor(<DateX>), 'MM/DD/YYYY').

sculptorlv
Contributor II

Re: Date comparing

Thank .. I guess this info could help me in my previous solution logic

Community Browser