The issue appears to be the division prettification in lifecycle.sql.

Changed it to simply grab the project type, we can grok the division info in datastudio
master
dtookey 4 years ago
parent b8b74efca2
commit 217e833756

@ -14,11 +14,10 @@ where invoice_accepted = 1;
CREATE INDEX ref_num ON billing_report (refNumber);
CREATE INDEX div_idx ON billing_report (division);
# So this little ditty will replace the raw project_type info with a prettified string. Only problem is it takes more than
# 10 minutes to run on our t3a.micro ec2 instance.
# UPDATE billing_report
# SET division = IF(
# division = 'Warranty',
# CONCAT(SUBSTRING(refNumber, 1, 3), ' - ', 'Structural'),
# CONCAT(SUBSTRING(refNumber, 1, 3), ' - ', division)
# );
UPDATE billing_report
SET division = IF(
division = 'Warranty',
CONCAT(SUBSTRING(refNumber, 1, 3), ' - ', 'Structural'),
CONCAT(SUBSTRING(refNumber, 1, 3), ' - ', division)
);

@ -2,7 +2,7 @@ DROP TABLE IF EXISTS event_counts;
CREATE TABLE event_counts AS
SELECT DATE(timestamp) AS event_date,
get_division_collapsed(project_number) AS division,
all_projects.proj_type AS division_raw,
if(substring(new_value, 1, 1) = '+', 1, -1) AS event_count,
SUBSTRING(`new_value` FROM 2) AS flag
FROM project_lifecycle

Loading…
Cancel
Save