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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tfilterrow create and/or criteria that includes current date plus 30 days

I am trying to create using advanced mode criteria where status equals active or status equals inactive and the closing date is less than or equal to today plus 30 days. this is what I have but it's not working....suggestions?

 

(

(input_row.status.equals("active"))

||

(((input_row.status.equals("inactive")) && (input_row.closing_dt<=TalendDate.ADD_TO_DATE(TalendDate.getCurrentDate(), "DD", 30)))

)

 

Error says 'insert ")" to complete ArgumentList

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

It's clear now, try this expression and let me know if it works.

(input_row.status.equals("active"))||((input_row.status.equals("inactive")&&(TalendDate.compareDate(input_row.closing_dt,TalendDate.addDate(TalendDate.getCurrentDate(), -30, "dd"))>=0)))

View solution in original post

12 Replies
Anonymous
Not applicable
Author

If the data type of input_row.closing_dt is Date type, try this expression:
(input_row.status.equals("active"))||((input_row.status.equals("inactive")&&(TalendDate.compareDate(input_row.closing_dt,TalendDate.ADD_TO_DATE(TalendDate.getCurrentDate(), "DD", 30))!=1)))

Anonymous
Not applicable
Author

Thanks Shong! yes Closed_dt is a date field.  Although i'm not getting the error when running any longer and it's able to run the filter as you have it now is not including any records that are 'active'. at the least on the table there are 1885 records where status = 'active', should i nest the && statements? 

Anonymous
Not applicable
Author

FYI Nesting the && statements didn't work, thoughts?

Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

what is the filter expression you are using now?

BTW, please insert your image into the post instead of attaching it!

Anonymous
Not applicable
Author

Yup sorry! 

 

This is what I have now: 

 

(input_row.STATUS.equals("active"))

||

(

((input_row.STATUS.equals("inactive")&&(TalendDate.compareDate(input_row.CLOSING_DT,TalendDate.ADD_TO_DATE(TalendDate.getCurrentDate(), "DD", 30))!=1)))

)

 

 

This image is the result i get when I run this subjob however in the table there are approx 1880+ 'active' records that should be going past the filter at the least. 

0683p000009M8gR.png

 

0683p000009M8gW.png

Anonymous
Not applicable
Author

I fixed syntax and it's running now however how it's not weeding out the inactive records that have a closing date greater than 30 days from today. records back with closing dates in 2012, 2013 are passing through the filter. Any suggestions are greatly appreciated! 

 

0683p000009M8hK.png0683p000009M6qz.png

Anonymous
Not applicable
Author

If you using the expression
(TalendDate.compareDate(input_row.CLOSING_DT,TalendDate.ADD_TO_DATE(TalendDate.getCurrentDate(), "DD", 30))!=1)))
It will includes all old date.

What is the date range of CLOSING_DT you want to filter?
today<=CLOSING_DT<today+30Days?
Anonymous
Not applicable
Author

Hi Shong, the second set of criteria should be STATUS = Inactive AND CLOSED_DT should be between TODAY and up to 30 days prior to today (so only loading inactive for records up to the last 30 days from today. )  THanks!