Moved and added data for graphs etc. for org dashboard
This commit is contained in:
parent
13021934e3
commit
e625dc8ffe
6 changed files with 242 additions and 2 deletions
|
@ -44,6 +44,7 @@ __PACKAGE__->add_columns(
|
|||
size => 255,
|
||||
is_nullable => 1,
|
||||
},
|
||||
# Stores codes based on https://www.ons.gov.uk/methodology/classificationsandstandards/ukstandardindustrialclassificationofeconomicactivities/uksic2007
|
||||
sector => {
|
||||
data_type => 'varchar',
|
||||
size => 1,
|
||||
|
|
|
@ -17,7 +17,8 @@ SELECT "value",
|
|||
"seller_id",
|
||||
DATE_TRUNC('hour', "purchase_time") AS "quantised_hours",
|
||||
DATE_TRUNC('day', "purchase_time") AS "quantised_days",
|
||||
DATE_TRUNC('week', "purchase_time") AS "quantised_weeks"
|
||||
DATE_TRUNC('week', "purchase_time") AS "quantised_weeks",
|
||||
DATE_TRUNC('month', "purchase_time") AS "quantised_months"
|
||||
FROM "transactions"
|
||||
/);
|
||||
|
||||
|
|
|
@ -15,9 +15,11 @@ SELECT "value",
|
|||
"purchase_time",
|
||||
"buyer_id",
|
||||
"seller_id",
|
||||
"sector",
|
||||
DATETIME(STRFTIME('%Y-%m-%d %H:00:00',"purchase_time")) AS "quantised_hours",
|
||||
DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time")) AS "quantised_days",
|
||||
DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time",'weekday 0','-6 days')) AS "quantised_weeks"
|
||||
DATETIME(STRFTIME('%Y-%m-%d 00:00:00',"purchase_time",'weekday 0','-6 days')) AS "quantised_weeks",
|
||||
DATETIME(STRFTIME('%Y-%m-00 00:00:00',"purchase_time")) AS "quantised_months"
|
||||
FROM "transactions"
|
||||
/);
|
||||
|
||||
|
|
Reference in a new issue