Forum Discussion
hnsbhat
Helper I
8 years agoHow to get previous Nth record Value from the specific date
I have a table which has Date, Stock symbol, Open, high, low , close. I have data for only for week days and in some cases week days also doesn't have data because of market holiday. What I am trying ...
- 8 years ago
Ashish_Mathur
Super User
8 years agoHi,
Can you share a dataset and also show the expected result.
- hnsbhat8 years ago
Helper I
Hi, Below is the data and expected result, I have tried to put three measures - Close -1, Close -3 and Close-4 to make clear what I am expecting. Thanks!
Date Symbol Open High Low Close 11/3/2017 ABC 118.20 126.45 117.65 123.60 11/3/2017 XYZ 1,776.00 1,789.35 1,767.00 1,772.00 11/4/2017 ABC 143.20 151.45 142.65 148.60 11/4/2017 XYZ 1,801.00 1,814.35 1,792.00 1,797.00 11/7/2017 ABC 149.75 152.30 141.20 147.95 11/7/2017 XYZ 1,809.85 1,816.15 1,776.35 1,781.00 11/8/2017 XYZ 1,798.90 1,808.35 1,775.30 1,776.00 11/8/2017 ABC 148.05 158.40 146.40 151.30 11/9/2017 XYZ 1,787.00 1,794.35 1,754.25 1,758.00 11/9/2017 ABC 151.85 155.90 149.10 155.40 11/10/2017 ABC 154.35 158.25 151.80 156.60 11/10/2017 XYZ 1,754.85 1,775.05 1,745.00 1,755.00 Result Expected: Date Symbol Close -1 Close -3 Close - 4 11/10/2017 ABC 155.40 147.95 148.60 11/10/2017 XYZ 1,758.00 1,781.00 1,797.00 11/9/2017 ABC 151.30 148.60 1,772.00 11/9/2017 XYZ 1,776.00 1,797.00 123.60