Free Trial

Alteryx Designer Desktop Discussions

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

Comparing Datasets With Unique Identifier - Stock Options Exercise Dates

CGIQV
8 - Asteroid

Vague title for a complex problem.

 

There are two tables with data that's linked by a unique identifier, Option ID.  Table A represents when options were granted and other specific values related to these grant dates.  Table B represents a date when options were exercised.  

 

INPUT

 

TABLE A (Granted)

Option IDService DateTotal OptionsTotal Value
0123402/01/2015

200

1,000

0123402/01/2016

200

1,500

0123402/01/2017

200

1,400

0123402/01/2018

200

1,300

 

TABLE B (Exercised)

Employee IDOption IDExercise DateTotal Options
987650123405/21/2017500

 

From these two tables we can see that Employee ID 98765 has been granted a total of 800 options.  On 5/21/2019 we see that 500 were exercised.

 

The goal is to find the sum of "Total Value" from Table A related to the exercising of these 500 options.

 

The rules in place would be as follows:

1. Exercised options will be attributed to the earliest service dates and count forward.

2. Each option at a specific date is equal in value.  100 options for 100 value on a specific date equals a value of 1 per option.

 

In this case, 500 exercised options would be attributed to:

 

Option IDDateTotalTotal Value
0123402/01/2015

200

1,000

0123402/01/2016

200

1,500

0123402/01/2017

100

700

 

The sum of Total Value is equal to 3,200.

 

The output would be very similar to Table B except instead of showing "Total Options" it should show the value related to those options.

 

OUTPUT

 

Employee IDOption IDExercise DateTotal Value
9876501234

05/21/2017

3,200

 

For regular usage, the input files will contain thousands of rows of data spanning numerous Employee IDs and Options.  The output would list all of the exercised options and values related to those.

 

 

4 REPLIES 4
john_miller9
11 - Bolide

@CGIQV ,

 

Here's one way to do it, using the generate rows tool.  Let me know if this works for you.

 

Options.png

CGIQV
8 - Asteroid

@john_miller9

 

At generate rows I'm getting:

 

Error: Generate Rows (7): Parse Error at char(0): Invalid type in operator <=.

 

 

danilang
19 - Altair
19 - Altair

Hi @CGIQV 

 

@john_miller9 has a good solution, but since options can be granted by the millions, his technique of generating rows could balloon quite quickly

 

Here's a different take on it that uses the original data set without extra rows and is based around calculating a running total.

 

WF.png

Results.png

 

 

Dan

CGIQV
8 - Asteroid

Worked perfectly.

 

I will now apply this to the bigger data set and see how it comes together.

 

Thanks for the assistance.

Labels
Top Solution Authors