Stock Analysis using Tableau – LOD Function

Being an avid follower of stock markets and thought of creating an area graph of stocks and highlighting the lows and high of the stock for the duration selected something similar to what we see on moneycontrol.com.

My output dashboard here:

Here I will show how to use LOD (Level of Detail) expression in Tableau (More information available here)

Step 1: Downloaded stock price data using getbhavcopy app, which gives an option to extract data of all the stocks at NSE or BSE with their open, close, high, low and volume. I downloaded data from 1st Jan’17 till 22nd Feb’18 data from the app. It looked liked this:

I used command prompt commands to combine all files into one file.

Step 2: Import the data into Tableau and create area graph for the date range and applied company name and actual date as filters. For this example, I applied context filter to actual date field (using add to context filter option in Filters)

Then I created 3 calculated fields to identify High and Low price for selected duration of stock company using LOD expression named Fixed using following Nested Fixed formula:

 

Step 3: Create the worksheet with dual axis as shown below:

 

Then, I integrated the worksheet into dashboard to create output dashboard where user can select any stock with date range user wants to get output with high and lows of that duration.

Thanks!

Do subscribe to my blog to keep receiving updates on new posts