ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

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

How to register a value using data from different dates

abradle4
6 - Meteoroid

I have a column indicating whether to buy, sell or hold a stock on a particular day.  There is also a date column indicating the change in the stock price by day.  So if I sold the stock on 2016 03 01, and the price of the stock went down on 2016 03 02, I want to register "Win" in a new column (Or "Loss") if the stock price went up on 2016 03 02.  Attached is a sample data set.  Column D is the new column I am trying to add.  How can I do this in Alteryx?

 

Thableaus
17 - Castor
17 - Castor

Hi @abradle4 

 

Is this what you want? 

 

Change_Stock.PNG

 

WF appended.

 

Cheers,

abradle4
6 - Meteoroid

Thank you!  I am not understanding if the statement accounts for the fact that the change in stock price needs to be referencing the next day's change in stock price (vs. the same day's change in stock price).  If we sold on March 1, we need to be looking at the stock price change on March 2 to understand it it is a win or loss.  

Having said that, would you recommend an update to the statement?

Thank you!!!

Thableaus
17 - Castor
17 - Castor

@abradle4 

 

If it's a comparison with the next day, would this be a good idea?

 

ChangeStoc.PNG

 

Cheers,

abradle4
6 - Meteoroid

Yes, this worked!  Thank you so much!

Labels