Fixed for change in data output

This commit is contained in:
2021-11-09 15:10:04 -06:00
parent 2116778276
commit e19a630a8b
6 changed files with 11 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
package runner
func (r *Runner) DescriptionTYD(description string) []Data {
// func (r *Runner) DescriptionTYD(description string) []Data {
}
// }

View File

@@ -44,10 +44,10 @@ func (r *Runner) ProcessExcel(path string) {
data := []Data{}
for i, row := range rows {
if i >= offset {
new_data := Data{SKU: row[33], Level2: row[29], Level3: row[30], Description: row[44]}
new_data := Data{SKU: row[34], Level2: row[30], Level3: row[31], Description: row[45]}
//Parse Rev
rev, err := strconv.ParseFloat(row[72], 64)
rev, err := strconv.ParseFloat(row[75], 64)
checkErr(err)
new_data.Revenue = rev
@@ -57,12 +57,12 @@ func (r *Runner) ProcessExcel(path string) {
new_data.Cost = cost
//Parse Quantity
qty, err := strconv.ParseInt(row[71], 10, 64)
qty, err := strconv.ParseInt(row[74], 10, 64)
checkErr(err)
new_data.Quantity = qty
//Parse Time
day, err := time.Parse("2006-01", row[26])
day, err := time.Parse("2006-01", row[27])
checkErr(err)
new_data.Year = int64(day.Year())
new_data.Month = int64(day.Month())

View File

@@ -7,5 +7,6 @@ CREATE TABLE IF NOT EXISTS data (
cost float,
quantity integer,
year integer,
month integer
month integer,
trend float
);