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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get previous row (tuple)'s value without using Custom Code components?

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.

Labels (2)
19 Replies
Anonymous
Not applicable
Author

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 🙂

SachinD
Creator
Creator

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.

 

 

Anonymous
Not applicable
Author

Hi, can you share the configuration of the tmap please??

Anonymous
Not applicable
Author

Hello, can you share the TMap editor . Thank you
Anonymous
Not applicable
Author

There is a screenshot above that shows the configuration. Click on it and it will allow you to zoom in.

Anonymous
Not applicable
Author

how to i access the next row elements? is there any method where instead of previous row i want the next row . thnk you in advance
Anonymous
Not applicable
Author

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.

Slope
Contributor III
Contributor III

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).

 

Anonymous
Not applicable
Author

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

Slope
Contributor III
Contributor III

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