Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

how to select second value and last value from the dataset

Sshasnk
8 - Asteroid

Hi I have a dataset where I have to pick the second row and last row of the record. Below is the example 

 

Idnamequantityprice
456214Alex5.0015.23
456214Raj10.00100.00
456214Tim10.0010.00
456214 25.00125.23
145267EXNick5.0020.00
145267EXLuffy5.0060.00
145267EX 10.0080.00
54123Leo5.0010.00
54123 5.0010.00

 

Conditions:

1. You can see all the records have different Ids and from them, I have to select second record row but if only two rows are present   just like the last record I have to pick the first row

2. I have to put the last record into the first row so all of them will be in the same row

Output:

IdnamequantityPricef1f2
456214Raj10.00100.0025.00125.23
145267EXLufy5.0020.0010.0080.00
54123Leo5.0010.005.0010.00

 

Let me know if you have any question

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@Sshasnk 
Hope this is what you need.

1207-Sshasnk.PNG

grazitti_sapna
17 - Castor

Hi @Sshasnk , Here is my solution to the problem, I guess there is mistake in the output you mentioned for Luffy the price should be 60 but you mentioned 20 in your output.

grazitti_sapna_0-1607323142250.png

 

If this is what you are looking for kindly mark this post as solution 

Thanks.

 

Sapna Gupta
Labels
Top Solution Authors