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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
MaryL
Contributor
Contributor

job depends from changeable values

Hello!

There is table with changeable values: two dates. And I need to create job which would run only if today is between that two dates from table.

Is it possible to do? And how? Could you please help.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

@Maryna Lykhoshva​ , You need to read dates from table, and then check if today is between the two dates on a tJavaRow, trigger the next processing using RunIf based on the checking result. The job looks like:

tMysqlInput--main--tJavaRow---runIf---next processing

 

on tJavaRow:

 

if(TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn1)==1&&TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn2)==-1){

context.condition=true;

}else{

context.condition=false;

}

 

 

//context.condition is context variable, boolean type, set its default value as false.

 

set the condition of runIf as: context.condition

 

Hope it helps you!

 

Regards

Shong

View solution in original post

4 Replies
evansdar
Contributor II
Contributor II

You could use a 'Run If' connection based on comparing 2 dates (TalendDate)

Run Iff: Current Date < date1 and Current Date > date2

MaryL
Contributor
Contributor
Author

yeah, but dates are often changed, so maybe Run If can check dates from table?

Anonymous
Not applicable

@Maryna Lykhoshva​ , You need to read dates from table, and then check if today is between the two dates on a tJavaRow, trigger the next processing using RunIf based on the checking result. The job looks like:

tMysqlInput--main--tJavaRow---runIf---next processing

 

on tJavaRow:

 

if(TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn1)==1&&TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn2)==-1){

context.condition=true;

}else{

context.condition=false;

}

 

 

//context.condition is context variable, boolean type, set its default value as false.

 

set the condition of runIf as: context.condition

 

Hope it helps you!

 

Regards

Shong

MaryL
Contributor
Contributor
Author

Thank you!

I'll try.