Fixed for change in data output
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package runner
|
||||
|
||||
func (r *Runner) DescriptionTYD(description string) []Data {
|
||||
// func (r *Runner) DescriptionTYD(description string) []Data {
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -7,5 +7,6 @@ CREATE TABLE IF NOT EXISTS data (
|
||||
cost float,
|
||||
quantity integer,
|
||||
year integer,
|
||||
month integer
|
||||
month integer,
|
||||
trend float
|
||||
);
|
||||
Reference in New Issue
Block a user