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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need to obtain the next value of a field in another column

I have a table with the values:

Field1

10

5

2

8

I need to create another field which gives me the next value of the Field 1.

i.e

Field1      Field2

10               5

5                 2

2                 8

8                 -

Please provide a solution..

1 Solution

Accepted Solutions
sunny_talwar

Try this

Table:

LOAD *,

RowNo() as RowNum;

LOAD * INLINE [

    Field1

    10

    5

    2

    8

];


FinalTable:

LOAD *,

Peek('Field1') as Field2

Resident Table

Order By RowNum desc;


DROP Table Table;

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Try this

Table:

LOAD *,

RowNo() as RowNum;

LOAD * INLINE [

    Field1

    10

    5

    2

    8

];


FinalTable:

LOAD *,

Peek('Field1') as Field2

Resident Table

Order By RowNum desc;


DROP Table Table;

Capture.PNG

buzzy996
Master II
Master II

check this check.PNG

Anonymous
Not applicable
Author

Thanks mate.