"0","weight_calc <- weight_calc %>% "
"0","   mutate(calculated_quantity = case_when("
"0","      .$deconMaterialName == ""dropbox"" ~ .$listed_quantity,"
"0","      .$default_value_units == ""lbs per sq_ft"" ~ .$listed_quantity * .$per_unit_value * .$default_value,"
"0","      .$description == ""cabinets"" & .$listed_units == ""count"" ~ .$listed_quantity * .$per_unit_value * .$default_value,"
"0","      .$description == ""cabinets"" & .$listed_units == ""lin_ft"" ~ .$listed_quantity * .$default_value,"
"0","      .$deconMaterialName == ""carpeting"" ~ .$listed_quantity * .$per_unit_value * .$default_value,"
"0","      .$description == ""windows"" ~ .$listed_quantity * .$default_value,"
"0","      .$description == ""doors"" ~ .$listed_quantity * .$default_value,"
"0","      .$per_unit_value_units == ""lbs per sheet"" ~ .$listed_quantity * .$per_unit_value,"
"0","      .$default_value > 0 ~ .$listed_quantity * .$default_value,"
"0","      .$per_unit_value > 0 ~ .$listed_quantity * .$per_unit_value,"
"0","      .$listed_units == ""lbs"" ~ .$listed_quantity)"
"0","   ) %>%"
"0","   mutate(calculated_quantity_units = case_when("
"0","      .$deconMaterialName == ""dropbox"" ~ .$listed_units,"
"0","      .$default_value_units == ""lbs per sq_ft"" ~ ""lbs"","
"0","      .$deconMaterialName == ""steel product"" & .$per_unit_value > 0 ~ .$per_unit_value_units,"
"0","      .$deconMaterialName == ""steel product"" & .$default_value > 0 ~ .$default_value_units,"
"0","      .$description == ""cabinets"" ~ ""kg"","
"0","      .$description == ""doors"" ~ ""kg"","
"0","      .$description == ""windows"" ~ ""kg"","
"0","      .$deconMaterialName == ""carpeting"" ~ ""lbs"","
"0","      .$per_unit_value_units == ""lbs per sheet"" ~ ""lbs"", "
"0","      .$default_value_units == ""lbs per bundle"" ~ ""lbs"","
"0","      .$default_value_units == ""lbs per fixture"" ~ ""lbs"","
"0","      .$per_unit_value_units == ""sq_ft"" & .$default_value_units == ""lbs per sq_ft"" ~ ""lbs"","
"0","      .$listed_units == ""bd_ft"" ~ ""cu_ft"","
"0","      .$per_unit_value_units == ""sq_ft"" & .$listed_units == ""lin_ft"" ~ ""cu_ft"","
"0","      .$per_unit_value_units == ""ft thickness"" & .$listed_units == ""sq_ft"" ~ ""cu_ft"","
"0","      .$deconMaterialName == ""hardwood flooring"" ~ ""cu_ft"","
"0","      .$default_value_units == ""lbs"" ~ .$default_value_units,"
"0","      .$listed_units == ""lbs"" ~ .$listed_units)"
"0","   )"
"0","# clean up calculated units"
"0","calc_unit_cleanup <- str_split_fixed(weight_calc$calculated_quantity_units, ""per"", n = 3)"
"0","weight_calc$calculated_quantity_units <- calc_unit_cleanup[,1]"
"0","rm(calc_unit_cleanup)"
