General Sales Report
Yearly Overview
SELECT A.account_id as account, from_unixtime(date_orig,"%Y") as yearmonth, count(id) as sales, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%% AND billing_status=1
GROUP BY yearmonth ORDER BY yearmonth ASC
0
Year:
yearmonth
true
true
Sales
sales
true
Revenue
amount
true
dol,2
dol,2
SELECT from_unixtime(date_orig,"%Y") as yearmonth, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%%
GROUP BY yearmonth ORDER BY yearmonth ASC
Monthly Overview
SELECT A.account_id as account, from_unixtime(date_orig,"%M, %Y") as yearmonth, count(id) as sales, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%% AND billing_status=1
GROUP BY yearmonth ORDER BY yearmonth ASC
0
Month and Year:
yearmonth
true
true
Sales
sales
true
Revenue
amount
true
dol,2
dol,2
SELECT from_unixtime(date_orig,"%M, %Y") as yearmonth, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%%
GROUP BY yearmonth ORDER BY yearmonth ASC
Weekly Overview
SELECT A.account_id as account, from_unixtime(date_orig,"%Y-%u") as yearmonth, count(id) as sales, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%% AND billing_status=1
GROUP BY yearmonth ORDER BY yearmonth ASC
0
Year and Week Number:
yearmonth
true
true
Sales
sales
true
Revenue
amount
true
dol,2
dol,2
SELECT from_unixtime(date_orig,"%Y-%u") as yearmonth, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%%
GROUP BY yearmonth ORDER BY yearmonth ASC
Daily Overview
SELECT A.account_id as account, from_unixtime(date_orig,"%m-%d-%Y") as yearmonth, count(id) as sales, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%% AND billing_status=1
GROUP BY yearmonth ORDER BY yearmonth ASC
0
Month, Day, and Year:
yearmonth
true
true
Sales
sales
true
Revenue
amount
true
dol,2
dol,2
SELECT from_unixtime(date_orig,"%m-%d-%Y") as yearmonth, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%%
GROUP BY yearmonth ORDER BY yearmonth ASC
Hourly Overview
SELECT A.account_id as account, from_unixtime(date_orig,"%k") as yearmonth, count(id) as sales, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%% AND billing_status=1
GROUP BY yearmonth ORDER BY yearmonth ASC
0
Hour of Day:
yearmonth
true
true
Sales
sales
true
Revenue
amount
true
dol,2
dol,2
SELECT from_unixtime(date_orig,"%k") as yearmonth, sum(total_amt) as amount from %%AGILE_DB_PREFIX%%invoice A
A.site_id = %%DEFAULT_SITE%%
GROUP BY yearmonth ORDER BY yearmonth ASC