Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to use the previous tuple(s)' value in an expression in tMap.
For eg.,
Input:
A | 2
B | 1
C | 4
D | 1
E | 3
Output (previous 2 tuples added):
A | 2 | 2
B | 1 | 3
C | 4 | 7
D | 1 | 6
E | 3 | 8
How to extract it in tMap expression? Or is there any other component to do it? I do not want to use stuff like tJavaXXXX or tPerlXXXX etc Custom Code or Database query components, which are shortcuts.
There are a few, but I don't tend to think about them as "tricks", just how I use them to solve certain problems. Nothing that I can just "list" I'm afraid 🙂
Thanks @rhall
I too tried your solution, and it works perfectly fine.
I tried such thing with tMap for first time and now understood power of tMap.
Thanks for sharing such solution, please keep sharing such good tricks.
Also Thanks @TalendSpree for posting this topic.
Sachin D.
Hi, can you share the configuration of the tmap please??
There is a screenshot above that shows the configuration. Click on it and it will allow you to zoom in.
No, you can't do that. But what is wrong with this method? You are essentially accessing the "next" row, just not in the way you think it should work. The other way this could be done is to simply use a sorting component to reverse the rows, then reverse then back after the component you wish to carry out your logic in.
Hello,
Thanks @rhall your solution help me a lot but my need is a bit different.
Here's what I've with the current solution :
OUTPUT 1 :
A | 2 | 2
B | 1 | 3
C | 4 | 7
D | 1 | 6
But what I need is :
A | 2 | 2
A | 1 | 3
B | 1 | 1
C | 1 | 1
C | 3 | 4
So I would like to "reset" the count for each different kind of input (A, B, C).
Hi @Slope,
This looks like it might be a slightly different problem. Can you raise this in a new thread and completely explain the problem please?
Thanks
Hi,
I created a new post before replying on this one.
Here's the link : https://community.talend.com/t5/Design-and-Development/Aggregation-on-one-attribut-and-keeping-date/...
Kind regards