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

Script: Inter-record comparison of values.

Hi everyone,

I am working with hierarchies. I now wanted to add one additional column to data that is linked to a hierarchy.

Unfortunately QlikView adds the additional values to too many values in the existing columns.

I've attached a table preview to make it more clear.

I only want to assign the value "Scope Q2" to the last instance of 204074-01 (with the hierarchy key G2).

Is it possible to check the next value in the field "Management ID" and only assign the value "Scope Q2"

to the row if the next Management ID is different?

Thank you in advance!

Best regards,

Mats

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can use the peek() script function to look ahead or back in records when loading. See the Help for info about peek().

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

5 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can use the peek() script function to look ahead or back in records when loading. See the Help for info about peek().

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

swuehl
MVP
MVP

Hi Rob,

how would you use Peek() to address the next record to be read in? Is this a new feature? Haven't seen this so far.

Regards,

Stefan

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Not a new feature, but only works on resident tables as far as I know. RecNo() represents the peek row of the next record.

data:

LOAD * INLINE [

X

A

B

C

];

data2:

LOAD

  X,

  peek('X', recno(), 'data') as Y

RESIDENT data;

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

swuehl
MVP
MVP

Ah, you are talking about peek'ing a resident table, that's what I missed.

Thought you have found a way to peek the next record from an input table that's currently loaded.

Thanks for clarification.

Anonymous
Not applicable
Author

It took me a while but I figured out how to use it in my application.

Thank you Rob!