Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Not applicable

Date calulation

I have a field called Target date

Target date

10/10/2017

Based on this date I need to calculate 3 more dates,

       executed date  - 60 days prior to Target date

·        Approved date  - 7 days prior  to executed  date

·        Selected date   - 45 days prior to Approved date

Here based on 10/10/2017,

Executed date would be - 8/10/2017

Approved date would be - 1/10/2017

Selected date would be  - 11/15/2016

How can I acheive this  ?

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Date calulation

Hi Try this.

Date(TargetDate -60)  for Executed Date

Date(TargetDate -60 - 7) for Approved Date

Date(TargetDate -60 - 7 - 45) for Selected Date

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

4 Replies
Highlighted
mwoolf
Honored Contributor II

Re: Date calulation

Something like:

date(num([Target Date])-60) as [Execute Date],

date(num([Target Date])-67) as [Approved Date],

date(num([Target Date])-112) as [Selected Date],

Highlighted
MVP & Luminary
MVP & Luminary

Re: Date calulation

Hi Try this.

Date(TargetDate -60)  for Executed Date

Date(TargetDate -60 - 7) for Approved Date

Date(TargetDate -60 - 7 - 45) for Selected Date

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

Highlighted
Not applicable

Re: Date calulation

Thank you @kaushiksolanki

and @mw...

I used the belwo script and that worked.

Date(TargetDate -60)  as Executed Date

date(Date(TargetDate -60 )- 7) as Approved Date

date(date(Date(TargetDate -60 )- 7)- 45) as Selected Date

Highlighted
MVP & Luminary
MVP & Luminary

Re: Date calulation

Great,

Kindly mark answer as correct.

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".