2023: Week 13 - Rolling stock price trends

Created by: Carl Allchin

The final challenge of Advanced Month involves working out moving calculations. At the time of writing this challenge they are not natively available in Tableau Prep so am intrigued by the solutions you might come up with. 

Trying to conduct complex analysis can be a challenge but simplifying the data set can make life much easier for end users. This is the logic we're trying to apply this week. 

Inputs

This week's challenge will use the same inputs as the 2023 Week 8 challenge. You can download it here.


Requirements

  • Input all the months of data available
  • Create a Trade Order field showing the order each trade has happened in for each Sector from the File Name and ID as the order of each trade within each monthly file
  • Remove all data fields except:
    • Trade Order
    • Sector
    • Purchase Price
  • Create a Parameter to allow the user to select the rolling number of trades to be incorporated into the moving average. 
    • I've set a default of 3 trades in my moving average/
  • Create a data set that records the previous 2 trades (where applicable) as well as that Trade Order record.
  • Workout the Rolling Average Purchase Price for each Trade Order in each Sector
  • Filter the data for the last 100 trades for each Sector
  • Create the Previous Trades field to show the oldest trade (1) through to the latest trade (100).
  • Output the Data

Output


One file:
  • 4 data fields:
    • Previous Trade 
    • Trade Order
    • Sector
    • Rolling Avg. Purchase Price
  • 1,300 rows of data (1,301 rows including headers)

You can download all the output from here

After you finish the challenge make sure to fill in the participation tracker, then share your solution on Twitter using #PreppinData and tagging @Datajedininja@JennyMartinDS14 & @TomProwse1

You can also post your solution on the Tableau Forum where we have a Preppin' Data community page. Post your solutions and ask questions if you need any help! 

Popular posts from this blog

2023: Week 1 The Data Source Bank

2023: Week 2 - International Bank Account Numbers

How to...Handle Free Text