Skip to content

Instantly share code, notes, and snippets.

@goodpic
Created September 15, 2018 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goodpic/a0e6186cc805d10c65a864ff0044451b to your computer and use it in GitHub Desktop.
Save goodpic/a0e6186cc805d10c65a864ff0044451b to your computer and use it in GitHub Desktop.
Create BigQuery table
exports.SchemaSalesByHour = [
{
description: 'Date and hour of the transactions',
name: 'date_hour',
type: 'DATETIME',
mode: 'REQUIRED'
},
{
description: 'UTC timestamp of the transactions',
name: 'timestamp',
type: 'TIMESTAMP',
},
{
description: 'Day of the transactions',
name: 'day',
type: 'STRING',
mode: 'REQUIRED'
},
{
description: 'Day of the transactions by numeric, 1=Mon...6=Sat, 0=Sun',
name: 'day_num',
type: 'INT64',
mode: 'REQUIRED'
},
{
description: 'Hour of the transactions',
name: 'hour',
type: 'STRING',
mode: 'REQUIRED'
},
{
description: 'Name of the shop',
name: 'shop_name',
type: 'STRING',
mode: 'REQUIRED'
},
{
description: 'Number of transactions',
name: 'transactions',
type: 'INT64',
mode: 'NULLABLE'
},
{
description: 'Number of customers',
name: 'customers',
type: 'INT64',
mode: 'NULLABLE'
},
{
description: 'Total amount which customers paid, including VAT and service charges',
name: 'sales',
type: 'FLOAT64',
mode: 'NULLABLE'
},
{
description: 'VAT Tax',
name: 'tax',
type: 'FLOAT64',
mode: 'NULLABLE'
},
{
description: 'Cost',
name: 'cost',
type: 'FLOAT64',
mode: 'NULLABLE'
},
{
description: 'Amout of discount to be adjusted',
name: 'discount',
type: 'FLOAT64',
mode: 'NULLABLE'
},
{
description: 'Net = Total - Tax, used by the daily sales report.',
name: 'net',
type: 'FLOAT64',
mode: 'NULLABLE'
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment