## Details

3PL- Data to Dollars Central NJ Data Science MEETUP.

Background of the Project

3PL Dataset Aalysis for Warehouse Management sytem.

Data setwd(“H:/Datascience”)

We received three files for Analysis

list.files(“../input”) %>% as.list %>% pander

ALL_EA_locations.xlsx CNJ.Labor_PICKING.xlsx CNJ.Labor_PUTAWAY.xlsx

Goal of the Project

3PL dataset Analysis to measure and lower cost in the supplychain/distribution sectpr while developing insights about total costs in serving clients.

** Required Package**.

#Load the required Packages.
library(needs)

#Load the required Packages.
needs(readxl,dplyr, tidyr, stringr, lubridate, readr, ggplot2,
      MASS,
      pander, formattable,knitr, viridis,gridExtra,grid)

Question : By doing some time analysis will/can you identify which side the aisle or the two stage areas may be ? If this can be interjected to existing data would you be able to proceed ?

#Identify the side of the Aisle w.r.t the location code provided.

supplychaindata <-  read.csv("H:/Datascience/supplychaindata.csv", header = TRUE, sep = ",")
## Location parsing
## Example : LOc_CODE 51Q019D  -
                   # 51 - Building number
                   # Q -  Aisle
                   # 019 - (space, If odd then - Aisle side is left, If even then - Aisle side is right)
                   # D - Level

# We can split the LOC_CODE to define the Aisle, Level and check if the number in Aisle space is odd then the Aisle is on the left side else if even then on right side.                    
supplychaindata = mutate(supplychaindata, D_BUILDING = str_sub(LOC_CODE,1,2),
                  D_AISLE = str_sub(LOC_CODE,3,3),
                  D_SPACE = as.numeric(str_sub(LOC_CODE,4,6)),
                  D_LEVEL = str_sub(LOC_CODE, -1, -1),
                  D_LEFT_AISLE = ifelse(D_SPACE%%2!=0,1,0),
                  D_RIGHT_AISLE = ifelse(D_SPACE%%2==0,1,0))
## Warning in eval(substitute(expr), envir, enclos): NAs introduced by
## coercion
head(supplychaindata)
##   JOB_TP_CODE DOC_NUM DOC_LINE_NUM  OP_CODE TER_CODE       LAB_DATE
## 1          PU  265794            4 NDEGAONA  1875722 5/3/2016 14:05
## 2          PU  265794            5 NDEGAONA  1875722 5/3/2016 14:05
## 3          PU  265794            6 NDEGAONA  1875722 5/3/2016 14:05
## 4          PU  265794            3 NDEGAONA  1875722 5/3/2016 14:05
## 5          PU  265794            7 NDEGAONA  1875722 5/3/2016 14:05
## 6          PU  265794            8 NDEGAONA  1875722 5/3/2016 14:05
##       START_DATE       END_DATE WHSE_CODE LOC_CODE IND_SRC D_DURATION_SECS
## 1 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 2 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 3 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 4 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY              15
## 5 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 6 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
##   D_BUILDING D_AISLE D_SPACE D_LEVEL D_LEFT_AISLE D_RIGHT_AISLE LAB_HOURS
## 1         50       -      NA       K           NA            NA     14:05
## 2         50       -      NA       K           NA            NA     14:05
## 3         50       -      NA       K           NA            NA     14:05
## 4         50       -      NA       K           NA            NA     14:05
## 5         50       -      NA       K           NA            NA     14:05
## 6         50       -      NA       K           NA            NA     14:05
##   START_HOURS END_HOURS LAB_DATES START_DATES END_DATES
## 1       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 2       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 3       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 4       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 5       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 6       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
# We notice that in coloumn D_LEVEL there is value "K" in many rorws. The value "K" comes from some LOC_CODES that are defined  as "50-DOCK",the above line of code splits 
#the word DOCK and assigns it to D_LEVEL columns. SO where ever the LOC_CODE has  DOCK it splits the word and takes its end letter "K" as the D_Level value.
# Since we know that there is no K level Aisle in the warehouse, we ca assign it as a missing value "NA".
supplychaindata$D_LEVEL[which(supplychaindata$D_LEVEL == "K")] <- NA
head(supplychaindata)
##   JOB_TP_CODE DOC_NUM DOC_LINE_NUM  OP_CODE TER_CODE       LAB_DATE
## 1          PU  265794            4 NDEGAONA  1875722 5/3/2016 14:05
## 2          PU  265794            5 NDEGAONA  1875722 5/3/2016 14:05
## 3          PU  265794            6 NDEGAONA  1875722 5/3/2016 14:05
## 4          PU  265794            3 NDEGAONA  1875722 5/3/2016 14:05
## 5          PU  265794            7 NDEGAONA  1875722 5/3/2016 14:05
## 6          PU  265794            8 NDEGAONA  1875722 5/3/2016 14:05
##       START_DATE       END_DATE WHSE_CODE LOC_CODE IND_SRC D_DURATION_SECS
## 1 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 2 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 3 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 4 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY              15
## 5 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
## 6 5/3/2016 14:05 5/3/2016 14:05        EA  50-DOCK PUTAWAY               3
##   D_BUILDING D_AISLE D_SPACE D_LEVEL D_LEFT_AISLE D_RIGHT_AISLE LAB_HOURS
## 1         50       -      NA    <NA>           NA            NA     14:05
## 2         50       -      NA    <NA>           NA            NA     14:05
## 3         50       -      NA    <NA>           NA            NA     14:05
## 4         50       -      NA    <NA>           NA            NA     14:05
## 5         50       -      NA    <NA>           NA            NA     14:05
## 6         50       -      NA    <NA>           NA            NA     14:05
##   START_HOURS END_HOURS LAB_DATES START_DATES END_DATES
## 1       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 2       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 3       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 4       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 5       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
## 6       14:05     14:05  5/3/2016    5/3/2016  5/3/2016
save(supplychaindata, file='supplychaindata.RData')
#write.csv(supplychaindata,file='supplychaindata.csv')

## We can add few more column to our dataset defining AISLE, LEVEL AND SIDE OF THE AISLE