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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

control table

Hi experts

 

I want to send source data in to final ware house every 15 minutes ,So I taught to create a control table in

staging area with DATE,TIMESTAMP as columns 

When the table in the source is updated , for example the source table is (sales_order ) the date column in sales_order is

(sales_order_date ) when the sales_order_date column gets updated the time is greater than TIME_STAMP column in staging then staging table should fetch the data from source to staging .

 

But how to replicate the column in control table in staging to give as condition in source .please help me to do it

or if any other solutions better than this please let me know

Thanks in advance 

 

Regards

Sumanth

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
Select the date column both from source table and control table, store the value to context variables for used later. Trigger other business processing using runIf connector based on the comparison result of the two dates. eg:
tmysqlinput--main--tJavaRow1-oncomponentok--tmysqlInput--main--tJavarow2
--runIf--other business processing
on tJavaRow1:
context.sourceDate=input_row.sales_order_date;

on tJavaRow2:
context.controlDate=input_row.TIME_STAMP_COLUMN;

Set the condition of runIf as:
TalendDate.compareDate(context.controlDate, context.sourceDate)==1

Hope it helps you.

Regards
Shong

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Hi,

Would you mind posting your current job design screenshots on forum which will be helpful for us to understand your requirement very weel?

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi
Select the date column both from source table and control table, store the value to context variables for used later. Trigger other business processing using runIf connector based on the comparison result of the two dates. eg:
tmysqlinput--main--tJavaRow1-oncomponentok--tmysqlInput--main--tJavarow2
--runIf--other business processing
on tJavaRow1:
context.sourceDate=input_row.sales_order_date;

on tJavaRow2:
context.controlDate=input_row.TIME_STAMP_COLUMN;

Set the condition of runIf as:
TalendDate.compareDate(context.controlDate, context.sourceDate)==1

Hope it helps you.

Regards
Shong

Anonymous
Not applicable
Author

Hi,
I'm new to talend I have no idea about
Context variables .
How to create and how to use
Can you please help me with it.
Regards
Sumanth..
Anonymous
Not applicable
Author

Open the Context viewer to create context variables, define the variable name and select the data type, set a default value if needed. In this case, you should select 'Date' type.

Once the variables are defined, you can use the variable like the format: context.varName in the job.
Anonymous
Not applicable
Author

Ok I will try it
Thanks for quick response ..
Anonymous
Not applicable
Author

hello Shong,as per your suggesion i created 2 context variable but when i connecting run if condition it cant be connected to output, and How to set run if condition  (TalendDate.compareDate(context.controlDate, context.sourceDate)==1
) means where to set condition???? i attached the screen shot of my job.

 

Kindly suggest.


talend.PNG
Anonymous
Not applicable
Author

Hi
RunIf can't be connected to output , it should be connected to another subjob, eg:
toracleinput1-main-tJavarow1--oncomponentok--tOracleInput2--main--tJavaRow2--runIf--tOracleInput3--main-->tOracleOutput3

The subjob starting from tOracleInput3 is triggered to run only when the condition of runIf is true.

Regards
Shong