# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Valued Contributor

## Peek and Above

Dear all,

My data is

 Country vas Values India 1 50 India 2 30 India 3 20 England 1 90 England 2 100 England 3 10 USA 1 60 USA 2 70 USA 3 80

i want to achieve lik this

 England 1 50 England 2 30 England 3 20 USA 1 90 USA 2 100 USA 3 10

Regards,

Joshua.

1 Solution

Accepted Solutions
Highlighted
MVP

## Re: Peek and Above

For script, you can try this

Table:

Country, vas, Values

India, 1, 50

India, 2, 30

India, 3, 20

England, 1, 90

England, 2, 100

England, 3, 10

USA, 1, 60

USA, 2, 70

USA, 3, 80

];

FinalTable:

If(vas = Previous(vas), Peek('Values')) as PreviousValues

Resident Table

Order By vas;

DROP Table Table;

5 Replies
Highlighted
MVP

## Re: Peek and Above

Script or front end?

Highlighted
Valued Contributor

## Re: Peek and Above

Dear Sunny,

How are you?

i want both in script and front end.

Regards,

Joshua.

Highlighted
MVP

## Re: Peek and Above

May be this for Front end

Aggr(Above(Values, 1), vas, Country)

Where hopefully Country is sorted in the script in the correct order.... India, England, USA

Highlighted
MVP

## Re: Peek and Above

For script, you can try this

Table:

Country, vas, Values

India, 1, 50

India, 2, 30

India, 3, 20

England, 1, 90

England, 2, 100

England, 3, 10

USA, 1, 60

USA, 2, 70

USA, 3, 80

];

FinalTable:

If(vas = Previous(vas), Peek('Values')) as PreviousValues

Resident Table

Order By vas;

DROP Table Table;

Highlighted
Valued Contributor

Thank you Sunny.