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

How to convert string to date format!

Hi Talend Support officer,
Can you tell me how can I convert the string data of "14/09/2001" from MS Access to DB2 date format ("yyyy-mm-dd") as "2001-09-14" by using tMap function in Talend Open Studio, please?
Thanks.
Regards,
KM

Labels (2)
58 Replies
bkar81
Contributor III
Contributor III

Set Max value(date) means?
From where we have to take the max date? Is it from the source file or do you want to load the source file based on some max date or???
If the option is one, then load the excel and put a tAggregateRow component and use the max function for that date field and in the next, use a tJava / tJavaRow component and set the context variable
If the option is two, on end of every load, take the max(date) from the target table/file and store it in a file/table. before starting the next load, load that value and assign it to the context variable same as above
Hope this is understandable 0683p000009MACn.png
Cheers,
Karthikeyan
Anonymous
Not applicable
Author

Hi bkar, here i explained you about my job process for incremental load............
In my source id, Date , Name all the things are column in excel, for context variable i have defined some default date value from the calendar initially.
My job is : tfileinputexcel _ tfilterrow(Date>context.Last_Date) _ tmssqloutput
main1 output
! subjob
tfileinputExcel

! row3main
taggregaterow (MaxDate=max(Date)
! row4 main
tjavarow context.Last_Date=MaxDate;
System.out.println(MaxDate);
My problem is the context variable is not changed at each run for incrmental load, if any solution than kindly provide me.
bkar81
Contributor III
Contributor III

Hi Mahadevan,
I could not understand how you have designed the job as it is in text (image would have been clear).
Are you able to see the value of MaxDate which you output using println? If yes, then try to use OnComponentOK / OnSubjobOK and set the value to the context variable. Initially, set a dummy value and check whether it is working. I had faced the same issue and found a solution/workaround like this.
Check this out, if you have any doubts
http://www.youtube.com/watch?v=GlKN_t2b7l4&list=UUgMggpVcEuwR4IxbD6uro9g

Regards,
Karthikeyan
bkar81
Contributor III
Contributor III

I have just created a mapping to check this and it works...
Checkout the screenshots
In tMap, I have filtered out null values and retained the value only for ID = 1
0683p000009MAE5.jpg 0683p000009MAEA.jpg 0683p000009MACy.jpg 0683p000009MAAZ.jpg 0683p000009MAEF.jpg 0683p000009MAEK.jpg
Anonymous
Not applicable
Author

Hi bkar81, thank you for your quick response.........
My expectation is i want to increase the context value for incremental load at each run. Here i attached my job process for understanding , i hope you understand my process.
In context variable i have assigned this value(Initial value)= 01/01/2000
In first main job iam filtering the data Whose input value is greater than context variable value.
In subjob i am getting the max (Date) from source to increase the context value at each run.
In tjavarow i am assigning this max (Date)value to context variable like Context variable=out.MaxDate

But the context variable is not getting the maxDate value from taggrow component ..................
0683p000009MAEP.jpg 0683p000009MAE1.jpg 0683p000009MAEU.jpg 0683p000009MAEZ.jpg
bkar81
Contributor III
Contributor III

There you go... In tJavarow, change row4.columname to input_row.columnname and it will work.
Follow the sample code generated by tJavaRow component.
Chk out my previous screenshot as well
Cheers,
Karthikeyan
Anonymous
Not applicable
Author

Hi any one can help to solve this problem..................
Here i creating a mapping for incremental load logic.
Here i created one context variable with some initial value is called Contex.Last_Date= 01/01/2000
MY Problem is...................
1. For First time load i used insert option in tmssqloutput for full load , here i got full rows from source correctly .
2.But in second load again it reads all the rows from source and its not filter the rows greater than contex.Last_Date, because the value of context variable is not changed in tfilter .

Please any one knows the solution, than kindly help me to solve this.
0683p000009MA3h.jpg 0683p000009MAEe.jpg 0683p000009M9x5.jpg 0683p000009M9oS.jpg
bkar81
Contributor III
Contributor III

If you are re-running this job again, then the context variable's values will be reset and will be the same as per the original design. For you to handle this, instead of storing the value to context variable, store the value to an external file/table and in the each run, read the value from the file and use Context load component to modify the value of the context variable.
By this way, the new date will be updated in the context variable.
Anonymous
Not applicable
Author

HI, can you provide me one schreen for incremental load logic.............
bkar81
Contributor III
Contributor III