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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select the value of a field from the previous row.

Hi,

Does anyone have some code or an example of selecting the value of a field from the previous record row?

I have a table containing call stats where a new record gets written when something happens to a call. Each call has a unique Call ID and i want to take the pervious records Call ID value and compair it to the next record CalI ID to see if they're the same or not?

I have looked into the Rowno () function but seem to be getting no where?

Please, any help would be appreciated?

Thanks, Joe

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

both, previous(<Fieldname>) and peek(<Fieldname,-1), is working (see attachment).

Have Fun with QV

Alex

View solution in original post

5 Replies
Not applicable
Author

You should use the function Previous, it will allow you to see the previous record in your Load select

Not applicable
Author

I guess you are talking about loading the data using script. If yes, then you can use peek() function.

Miguel_Angel_Baeyens

Hello Joe,

If you are talking about the data once it has been loaded, say a chart, you can use before() and after() functions. I use them when I want to get the Year to Date accrued value, so the current cell value depends on the previous value. But yes, it is once you have already loaded your data into a chart/table.

Regards.

Not applicable
Author

Hi,

both, previous(<Fieldname>) and peek(<Fieldname,-1), is working (see attachment).

Have Fun with QV

Alex

Not applicable
Author

Works like a charm! Example was perfect, thanks loads!

Cheers, Joe