rileybloke
New Member
- Joined
- Feb 7, 2013
- Messages
- 43
Hi, is there a way to find the second largest number in a column of data?
I need to return the second largest ORD_QTY for only Q quantities, and for each item.
I have tried RANKX but cant seem to get it to work, or is there an easier method?
Thanks all in advance
ITEM Date PQX ORD_QTY
121209-0001 01/10/2014 00:00 Q 560
121209-0001 02/10/2014 00:00 Q 560
121209-0001 06/10/2014 00:00 Q 1680
121209-0001 13/10/2014 00:00 Q 2760
121209-0001 20/10/2014 00:00 Q 2800
121209-0001 27/10/2014 00:00 Q 1400
121209-0001 03/11/2014 00:00 Q 2640
121209-0001 10/11/2014 00:00 Q 2640
121209-0001 17/11/2014 00:00 Q 2600
121209-0001 24/11/2014 00:00 Q 2640
121209-0001 01/12/2014 00:00 Q 2640
121209-0001 08/12/2014 00:00 Q 2640
15B533-0002 01/10/2014 00:00 Q 72
15B533-0002 06/10/2014 00:00 Q 144
15B533-0002 13/10/2014 00:00 Q 432
15B533-0002 20/10/2014 00:00 Q 360
15B533-0002 27/10/2014 00:00 Q 144
15B533-0002 03/11/2014 00:00 Q 288
15B533-0002 10/11/2014 00:00 Q 288
15B533-0002 17/11/2014 00:00 Q 288
15B533-0002 24/11/2014 00:00 Q 288
15B533-0002 01/12/2014 00:00 Q 288
15B533-0002 08/12/2014 00:00 Q 360
15B533-0002 15/12/2014 00:00 Q 288
15B533-0002 22/12/2014 00:00 Q 288
15B533-0002 29/12/2014 00:00 Q 288
15B533-0002 05/01/2015 00:00 Q 288
15B533-0002 12/01/2015 00:00 Q 288
15B533-0002 19/01/2015 00:00 Q 288
15B533-0002 26/01/2015 00:00 Q 288
15B533-0002 02/02/2015 00:00 Q 288
15B533-0002 09/02/2015 00:00 Q 288
15B533-0002 16/02/2015 00:00 Q 288
15B533-0002 23/12/2014 00:00 X 1224
15B533-0002 20/01/2015 00:00 X 612
121209-0001 22/09/2014 00:00 P 1280
121209-0001 29/09/2014 00:00 P 2720
121209-0001 06/10/2014 00:00 P 2400
121209-0001 13/10/2014 00:00 P 1920
121209-0001 20/10/2014 00:00 P 2000
121209-0001 27/10/2014 00:00 P 1600
121209-0001 03/11/2014 00:00 P 2720
121209-0001 10/11/2014 00:00 P 2560
121209-0001 17/11/2014 00:00 P 2960
15B533-0002 29/09/2014 00:00 P 765
15B533-0002 27/10/2014 00:00 P 306
15B533-0002 24/11/2014 00:00 P 1071
I need to return the second largest ORD_QTY for only Q quantities, and for each item.
I have tried RANKX but cant seem to get it to work, or is there an easier method?
Thanks all in advance
ITEM Date PQX ORD_QTY
121209-0001 01/10/2014 00:00 Q 560
121209-0001 02/10/2014 00:00 Q 560
121209-0001 06/10/2014 00:00 Q 1680
121209-0001 13/10/2014 00:00 Q 2760
121209-0001 20/10/2014 00:00 Q 2800
121209-0001 27/10/2014 00:00 Q 1400
121209-0001 03/11/2014 00:00 Q 2640
121209-0001 10/11/2014 00:00 Q 2640
121209-0001 17/11/2014 00:00 Q 2600
121209-0001 24/11/2014 00:00 Q 2640
121209-0001 01/12/2014 00:00 Q 2640
121209-0001 08/12/2014 00:00 Q 2640
15B533-0002 01/10/2014 00:00 Q 72
15B533-0002 06/10/2014 00:00 Q 144
15B533-0002 13/10/2014 00:00 Q 432
15B533-0002 20/10/2014 00:00 Q 360
15B533-0002 27/10/2014 00:00 Q 144
15B533-0002 03/11/2014 00:00 Q 288
15B533-0002 10/11/2014 00:00 Q 288
15B533-0002 17/11/2014 00:00 Q 288
15B533-0002 24/11/2014 00:00 Q 288
15B533-0002 01/12/2014 00:00 Q 288
15B533-0002 08/12/2014 00:00 Q 360
15B533-0002 15/12/2014 00:00 Q 288
15B533-0002 22/12/2014 00:00 Q 288
15B533-0002 29/12/2014 00:00 Q 288
15B533-0002 05/01/2015 00:00 Q 288
15B533-0002 12/01/2015 00:00 Q 288
15B533-0002 19/01/2015 00:00 Q 288
15B533-0002 26/01/2015 00:00 Q 288
15B533-0002 02/02/2015 00:00 Q 288
15B533-0002 09/02/2015 00:00 Q 288
15B533-0002 16/02/2015 00:00 Q 288
15B533-0002 23/12/2014 00:00 X 1224
15B533-0002 20/01/2015 00:00 X 612
121209-0001 22/09/2014 00:00 P 1280
121209-0001 29/09/2014 00:00 P 2720
121209-0001 06/10/2014 00:00 P 2400
121209-0001 13/10/2014 00:00 P 1920
121209-0001 20/10/2014 00:00 P 2000
121209-0001 27/10/2014 00:00 P 1600
121209-0001 03/11/2014 00:00 P 2720
121209-0001 10/11/2014 00:00 P 2560
121209-0001 17/11/2014 00:00 P 2960
15B533-0002 29/09/2014 00:00 P 765
15B533-0002 27/10/2014 00:00 P 306
15B533-0002 24/11/2014 00:00 P 1071