Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
For script, you can try this
Table:
LOAD * INLINE [
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:
LOAD *,
If(vas = Previous(vas), Peek('Values')) as PreviousValues
Resident Table
Order By vas;
DROP Table Table;
Script or front end?
Dear Sunny,
How are you?
i want both in script and front end.
Regards,
Joshua.
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
For script, you can try this
Table:
LOAD * INLINE [
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:
LOAD *,
If(vas = Previous(vas), Peek('Values')) as PreviousValues
Resident Table
Order By vas;
DROP Table Table;
Thank you Sunny.