How to create fiscal calendar in Incorta?(Part 3)

 The third part is the PySpark dataframe, this part is the most challenging part for me. Writing this part with PySpark is simpler and easier since we can get the data we want based on the previous result. For example, fiscal quarter seq and fiscal week of quarter can be built on the top of fiscal quarter number, and so on. I also practice how to use the window function in dataframe. For example, calculating fiscal year end date, fiscal month start date, fiscal month end date, and so on. 

  1. For getting the fiscal quarter number, we can use divide the week of year by 13. 
  2. For getting the fiscal month of quarter, we can depend on the fiscal week of quarter. When fiscal week of quarter <= 4, it is the first month of the quarter, and the month of quarter is 1. When fiscal week of quarter <=4+5, fiscal week of quarter is 2.  When fiscal week of quarter <=4+5+4, fiscal week of quarter is 3. Otherwise, when there are more than 52 weeks in a year, fiscal week of quarter is 3
  3. For getting fiscal year end date, fiscal month start date, fiscal month end date, we can use window function to partition data by fiscal year or fiscal month number to get the maximum or minimum value. 


Below is a screenshot of the dashboard in Incorta.



Comments

Popular posts from this blog

How to create fiscal calendar in Incorta?(Part 2)

How to create histogram in Incorta use bin function.

Using Incorta and PySpark Linear Regression ML package to predict eCommerce Customer