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: 
PCHANGUE
Contributor II
Contributor II

Question about tmap with multiple outputs - rows order - 7.3.1

Hi,

first of all, sorry for my poor english .. i'm a french speaker.

i would like to ask a question about the rows orders in a tmap with 2 outputs.

As you can see, i'm doing a "simple" job with a DB Connection, followed by a filereading (tfileInputFullRow) which is followed by a tmap with 2 outputs (initially it is 2 tdboutputs which goes in 2 different tables but i changed it into 2 tfileOuputDelimited which goes to the same txt file, to really see what's happening).

Also, I'm using the same sequence value (postgres) in the 2 outputs, nexval for the 1st, and currval for the 2nd ...

0695b00000LyfOrAAJ.png 

The original file has 5 rows as followed

test1

blabla1

test2

blabla2

blabla3

 

I want the test* lines to be insert in the 1st tdboutput and the blabla* ones in the 2nd tdbouput.

Everything is doing fine EXCEPT that the row orders is not respected, indeed, the result in the output file contains (i addthe sequence in the 2nd field) :

test1 1

test2 2

blabla1 2

blabla2 2

blabla3 2

 

Instead of :

test1 1

blabla1 1

test2 2

blabla2 2

blabla3 2

 

With the 2 tlogrows, the row orders is well respected, BUT, in other components like tdboutput it isn't ...

Can someone please help me ? i've tried many things ... 😞

 

Thank you

--

Pascal

Labels (2)
1 Solution

Accepted Solutions
PCHANGUE
Contributor II
Contributor II
Author

Hi,

i finally managed to get through this probleme by using the talend function Numeric.sequence(), that i set in the tmap, instead of the nextval and currval.

With a nextval before, and a setval after.

 

Thank you

 

Pascal

View solution in original post

3 Replies
Anonymous
Not applicable

Hi

Can show us the sequence function expression you are using on tMap? A screenshot of tMap is helpful for us to understand the issue well.

 

Regards

Shong

PCHANGUE
Contributor II
Contributor II
Author

Hi,

sorry for the late reply, i have been sick ..

 

Here is a screenshot of the tmap

0695b00000LyxngAAB.png 

And the sequence function expression is defined for the field idcmdcarte, as followed :

  • "nextval('ods.oficmdcarte_seq')" for the 1st output (cmdcarte)
  • "currval('ods.oficmdcarte_seq')" for the 2nd one (porteurs)

These functions are set on the advanced settings of the 2 tdboutput, like this.

0695b00000LyxvKAAR.png 

 

Thank you

--

Pascal

PCHANGUE
Contributor II
Contributor II
Author

Hi,

i finally managed to get through this probleme by using the talend function Numeric.sequence(), that i set in the tmap, instead of the nextval and currval.

With a nextval before, and a setval after.

 

Thank you

 

Pascal