Alteryx Designer Desktop Discussions

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

How to find first date and the last date of the Mutual fund transaction and the order

rajukrish21
5 - Atom

Dear all, 

 

I have a Mutual funds data set which contains the Customer ID, Product code, Transaction date( where he had done the Buy or SELL of the units), BUY/SELL(Bought or sold units on that date) and the Qty.

 

I wanted to find the first date when the customer is buying a product and its units and the last date where he sold all the units of that particular product. If he doesn't sell the product units fully, his product is still active and there will be no close date for that product

 

Customer IDProduct CodePayments DateTransaction dateTransaction TypeQuantity
A121ABC 1/1/10Buy

70

A121ABC 5/6/10Buy80
A121CDE 4/7/10Buy120
A121ABC 6/8/10Sell20
A121ABC 7/5/10Buy50
A121CDE 6/8/11Buy100
A121ABC 7/5/14Sell180
A121ABC 1/1/23Buy100

 

 

a. For the dates, we use Transaction date column, if Transaction date column is NULL , we use value in Payment date column

b. If the quantity is NULL , we remove the data

c. We take only the transactions till 31/12/2023

d. Sequence column, we need to find the order in which the product is bought and sold. for eg , if a product A is bought and sold fully, the sequence will be 1. Again in future , if the customer is buying same product, the sequence will become 2.

 

Thanks In advance. Your help is much appreciated. :) 

 

Final Output should look like the below table:

 

Customer IDProduct CodeTransaction Open DateTransaction Close DateNet UnitsSequence
A121ABC1/1/107/5/1401
A121CDE4/7/10-2201
A121ABC1/1/23-1002
1 REPLY 1
Yoshiro_Fujimori
15 - Aurora

Hi @rajukrish21 ,

 

I followed the conditions you raised above, but 

the sample data does not include the test cases for the conditions a, b, c.

If you want to test, please add rows.

And I assume the date format of your sample data is d/m/yy.

I hope this helps.

 

Workflow

1271701_Workflow.png

Condition a : Formula tool

Date = IF IsNull([Transaction date]) THEN [Payments Date] ELSE [Transaction date] ENDIF

 

Condition b : Filter tool

!IsNull([Quantity])

 

Condition c : Filter tool

[Date] <= "2023-12-31"

 

 

Labels