Template:Historical sales quantity fields

From MediaWiki

Revision as of 17:53, 15 March 2019 by Jan Steinman (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Usage

This template is used to provide the fields in the various quantity tables on the historical sales page. They are collected here in the interest of easily adding new years, or changing the basic format and information. This template is unlikely to be useful in any other way.

Parameters

  1. none

Bugs

Example

   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2007' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2007_sales">2007</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2008' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2008_sales">2008</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2009' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2009_sales">2009</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2010' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2010_sales">2010</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2011' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2011_sales">2011</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2012' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2012_sales">2012</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2013' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2013_sales">2013</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2014' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2014_sales">2014</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2015' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2015_sales">2015</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2016' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2016_sales">2016</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2017' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2017_sales">2017</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2018' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2018_sales">2018</a>`,
   FORMAT(SUM(CASE WHEN YEAR(sales.Date)='2019' THEN sales.Quantity ELSE NULL END), 3) AS `<a href="/wiki/2019_sales">2019</a>`,
   FORMAT(SUM(sales.Quantity), 3) AS 'Total'

FROM

   s_product_sales_log sales

See Also

Template

Share your opinion


blog comments powered by Disqus
Personal tools
Get our newsletter!
Name:
Email Address:

disturbance
entry points
help (off site)
Environmental jobs, green volunteering, good work! Powered by the wind! This server and other
EcoReality operations
are 100% wind powered.
Powered by Mac OS X Powered by Mac MediaWiki Powered by MariaDB Powered by Valentina Studio Pro