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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

required a output from tjava

Hi,

 

I want to get the output as below using tjava

sep-18

sep-17

jun-18

mar-17

mar-18

mar-19

mar-20

 

i need all the result only in date format

Labels (3)
6 Replies
Anonymous
Not applicable
Author

What is the input for the same?
Anonymous
Not applicable
Author

no input. i have to achieve it with tjava.

for tjava we no need input?

Anonymous
Not applicable
Author

Do you want to store the output in variables or display it on Console?

Anonymous
Not applicable
Author

is it possible to store the output in excel file?variable also okay.but my requirement is based on the output. i will pass the output values to sql query as parameter

Anonymous
Not applicable
Author

0683p000009LyX0.png0683p000009LyO7.png

Please try this way ..You have to insert your data in desired format in .csv file and column data type as string then pass it to tmap with data type as string then in tjavarow(1 intput column :date_output and 1 output column)  you can enter code like below:

op.date_output will be input column(string)
output_row.date_output=TalendDate.parseDateLocale("MMM-yy",op.date_output,"en");

where date_output will be of type date "MMM-yy"

then join it to tLogRow. you will get the output !!

Anonymous
Not applicable
Author

Thanks for your reply.

 

i was asking can we print the output in excel. but you have showed in tlogrows.

 

i have already got the desired output in tjava,but i dont know how to pass those values as globalvar or parameter in my sql query.

below is the code which i am using, can you help me to solve this issue.

 

1. Date lastDec =TalendDate.parseDate("yyyy-MM-dd", TalendDate.getDate("yyyy-MM-dd"));
System.out.println("param1: "+TalendDate.TO_CHAR(lastDec, "MMM-yy"));

 

2. Date prevYear1 = TalendDate.ADD_TO_DATE(lastDec, "YYYY", -1);
System.out.println("param3: "+TalendDate.TO_CHAR(prevYear1, "MMM-yy"));

 

3. Date prevYear = TalendDate.ADD_TO_DATE(lastDec, "MM", -3);
System.out.println("param2: "+TalendDate.TO_CHAR(prevYear, "MMM-yy"));

 

code 1 will take the current month and year.based on lastDec remaining will be calculated.

so now i want to know how to pass those values from tjava as globalvar or parameter in my sql query