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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date within no of days / not within / in the past

Hi, I'd like help with the following please if possible.

I have a date field called INVOICE_DATE. I want to write the following in script :

If INVOICE_DATE is not within 30 days (in the future) from today THEN 'Pass',       ///E.G INVOICE_DATE = 11/20/17

   If INVOICE_DATE is within 30 days (in the future) from today THEN 'Check',        ///E.G INVOICE_DATE = 3/15/17

      If INVOICE_DATE is in the past THEN 'Fail',                                                    ///E.G INVOICE_DATE = 1/5/16


AS DATE_STATUS

Thanks

R

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

May be this

If(INVOICE_DATE>today()+30,'Pass',

     If(INVOICE_DATE<= today()+30 AND INVOICE_DATE >= today(),'Check','Fail')) as DATE_STATUS,

   


OR


If(INVOICE_DATE>Date(today()+30),'Pass',

     If(INVOICE_DATE<= Date(today()+30) AND INVOICE_DATE >= Date(today()),'Check','Fail')) as DATE_STATUS,

View solution in original post

1 Reply
aarkay29
Specialist
Specialist

May be this

If(INVOICE_DATE>today()+30,'Pass',

     If(INVOICE_DATE<= today()+30 AND INVOICE_DATE >= today(),'Check','Fail')) as DATE_STATUS,

   


OR


If(INVOICE_DATE>Date(today()+30),'Pass',

     If(INVOICE_DATE<= Date(today()+30) AND INVOICE_DATE >= Date(today()),'Check','Fail')) as DATE_STATUS,