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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Sequence Generation

Hi All,
My source is as below ( refer to screenshot which has nulls under C1 column).
My expected output is as below (refer to screenshot which has no nulls).

Kindly assist.
Thanks,
Saty.
0683p000009ME6T.jpg 0683p000009MDg3.jpg
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi id4dsc,
Numeric.sequence(inputrow.c2,2,1)

janhess's suggestion is pretty good. I upload my screenshots to let you understand it more clearly.
Best regards
Sabrina
0683p000009MDrG.png 0683p000009MDfe.png

View solution in original post

9 Replies
Anonymous
Not applicable
Author

Hi,
Could you show us your screenshot of your work flow? Which component do you use to get such actual result? And what about your original data? More information will help us to give you a precise answer.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Sabrina,
I have the source as in the screenshot ( refer to screenshot which has nulls under C1 column).
And I didn't get the output. I'm trying to do it in MySQL.. But I want to do it in Talend job itself.
Kindly assist.
Thanks,
Saty.
Anonymous
Not applicable
Author

Hi,
From your expected result screenshot, I have seen the sequence is "2,3,4,5,2,3,4,2,3,4,5,6". Is any rule in it?
You can use component tMap and set a local variable for sequence.
See my screenshots
The expression is:
Numeric.sequence("s1",2,1)

Best regards
Sabrina
0683p000009ME6Y.png 0683p000009ME6d.png
Anonymous
Not applicable
Author

Hi Sabrina,

The expression is:
Numeric.sequence("s1",2,1)


Thanks for the reply. I'm aware of the above expression to generate sequence. But my requirement is as below.

I have 3 unique values under C2 column. If a value under C2 repeats for 4 times then C1 should start from 2,3,4,5.
If another value under C2 repeats for 9 times then C1 should start from 2,3,4,5,6,7,8,9,10 etc,.
I hope u have understood this.
Thnx,
Saty.
janhess
Creator II
Creator II

you have to base your sequence on the value in C2.
Numeric.sequence(inputrow.c2,2,1)
Anonymous
Not applicable
Author

Hi id4dsc,
Numeric.sequence(inputrow.c2,2,1)

janhess's suggestion is pretty good. I upload my screenshots to let you understand it more clearly.
Best regards
Sabrina
0683p000009MDrG.png 0683p000009MDfe.png
Anonymous
Not applicable
Author

Numeric.sequence(inputrow.c2,2,1)

Hi Janhess,
Thanks. It is working.
Hi Sabrina,
I have used above expression in my job and got the output. Thanks for reply.

Thanks,
Saty.
Anonymous
Not applicable
Author

Hi,
Please let me know how achieve not equal to condition in Talend?
Ex: Have Table 1 and Table 2 with fileds as field 1 from table 1 and filed 2 from table 2. Now i want to join these tables and check whether table 1.filed 1<> table 2.filed 2.

Please let me know how I can achieve this..
Anonymous
Not applicable
Author

Hi srk08536,
Please open a new topic for your issue.
Ex: Have Table 1 and Table 2 with fileds as field 1 from table 1 and filed 2 from table 2. Now i want to join these tables and check whether table 1.filed 1<> table 2.filed 2.

Did you see the component tMap. You can join two table and set a condition in it.
Best regards
Sabrina