Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
andreasignori
Contributor
Contributor

Is possible to dinamically create the output?

Hi guys

I'm sorry to bother you again, I'm in a pretty complicated situation(for me it's really complicated, i'm new in talend).

I've a csv file like this:

01/01/2021;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0

02/01/2021;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0

03/01/2021;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0

04/01/2021;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0

97 column in total, first column it's a date, the remaining 96 are floats. I have to save every single one of these 96 values ​​on a database, with each of them the date and time must also be saved, the time is made up of 15 (minutes) * position in the column. (these floats represent a measurement taken every 15 minutes, so I thought I'd calculate the hour by making 15 minutes * the position in the column, if you have better solution please feel free to expose it).

I was thinking about 2 possible solution, the first is to use 1 fileinput delimiter and 1 tmap, 1 output for each column, but i don't really like this idea.

The second idea is to use a tJavaFlex component, and use it to create the desired output (data, time, value) for each cell of my table of values.

What I expect to achieve is then to create 96 outputs * each line of the file. I was wondering how can I dinamically access to each column inside my tJavaFlex component and create the desired number of results?

Labels (4)
1 Solution

Accepted Solutions
gjeremy1617088143

HI , maybe you can do this :

0695b00000Gi5emAAB.jpg0695b00000Gi5cXAAR.jpg0695b00000Gi5ehAAB.jpg0695b00000Gi5ecAAB.jpg0695b00000Gi5eXAAR.jpg0695b00000Gi5eSAAR.jpg0695b00000Gi5eNAAR.jpg 

Send me Love and Kudos

View solution in original post

4 Replies
gjeremy1617088143

HI , maybe you can do this :

0695b00000Gi5emAAB.jpg0695b00000Gi5cXAAR.jpg0695b00000Gi5ehAAB.jpg0695b00000Gi5ecAAB.jpg0695b00000Gi5eXAAR.jpg0695b00000Gi5eSAAR.jpg0695b00000Gi5eNAAR.jpg 

Send me Love and Kudos

gjeremy1617088143

a little update to have all the values

0695b00000Gi63DAAR.jpg0695b00000Gi638AAB.jpg0695b00000Gi633AAB.jpg

andreasignori
Contributor
Contributor
Author

Man, this is much more (I would never have done it alone) complicated than I expected. BUT EVERYTHING WORKS! Now I just have to study it and understand how it works!

 

I'm sending you all my love! I really want to offer you a pizza ( not with pineapple, i'm italian don't do this to me. #StopPizzaWithPineapple).

 

You were amazing! How long have you been working with talend? and Why the choice of the row generator?

gjeremy1617088143

Glad it Works !

for more explanation :

first i read the file with only one field(i want the entire line) thats what i use a random field delimiter here « htht » i’m ensured it wasn’t in your dataset .

Then i use tflowtoiterate to apply the rest of the flow one row at a time and it also permit me to stock values in globalMap. I use trowgenerator cause it permit me to generate new rows with the value i want .

left method allow me to keep only the first 10 char (here the date)

and substring keep the string from the 11th char until the end of the string(Here i don’t want the ; just after the date so the result was 0;0;0...;0.

tnormalize permit me to make one row for each 0.

tjavaflex allow me to iterate on each row and add +1 to the var i each time it iterate.

 

I began Talend 2 years ago, and i was always amazed in how you can hijack everything if you are stuck and find another way to realize the data flow.

best pizzas are with mozzarella di buffala 😉 .

Send me love and Kudos