{
  "id": 9935,
  "title": "Decreasing sales trend in data",
  "url": "/competitions/acquire-valued-shoppers-challenge/discussion/9935",
  "author_name": "ashok k harnal",
  "post_date": "2014-08-03T08:36:58.663000",
  "votes": 0,
  "comment_count": 0,
  "views": 1128,
  "content": "<p>I have summed up sales between 3 and 7th months (both months inclusive) of 2012 and 2013 for categories that were put on offer. I find that for a large number of categories there is major reduction in sales volume. Here is the code and data:</p>\n<p>select category, year(dateofpurchase) as year, sum(purchasedfor) from transactions_offers where month(dateofpurchase) between 3 and 7 group by category, year order by category,year limit 90000<br>+----------+------+-------------------+<br>| category | year | sum(purchasedfor)|<br>+----------+------+-------------------+<br>| 1703 | 2012 | 28986.30002164841 |<br>| 1703 | 2013 | 10648.51999127865 |<br>| 1726 | 2012 | 11899.61992621422 |<br>| 1726 | 2013 | 7049.299947738647 |<br>| 2119 | 2012 | 4322.709998846054 |<br>| 2119 | 2013 | 94959.39884486422 |<br>| 2202 | 2012 | 7916.299895346165 |<br>| 2202 | 2013 | 223.5799942016602 |<br>| 3203 | 2012 | 157621.0895465594 |<br>| 3203 | 2013 | 104274.2899192739 |<br>| 3504 | 2012 | 5121.5100055933 |<br>| 3504 | 2013 | 1935.020009160042 |<br>| 3509 | 2012 | 621019.9812324326 |<br>| 3509 | 2013 | 318590.9155675694 |<br>| 4401 | 2012 | 164596.8396745101 |<br>| 4401 | 2013 | 99559.39939513803 |<br>| 4517 | 2012 | 84152.93815687299 |<br>| 4517 | 2013 | 159402.7559259534 |<br>| 5122 | 2012 | 108588.8687553424 |<br>| 5122 | 2013 | 55550.95930415392 |<br>| 5558 | 2013 | 37749.19992566109 |<br>| 5616 | 2012 | 586610.0291579217 |<br>| 5616 | 2013 | 296298.3700178023 |<br>| 5619 | 2012 | 892.3400001525879 |<br>| 5619 | 2013 | 34.8799991607666 |<br>| 5824 | 2013 | 2764.569940200076 |<br>| 6202 | 2012 | 11362.31975889206 |<br>| 6202 | 2013 | 34368.33889818192 |<br>| 706 | 2012 | 140836.3202348445 |<br>| 706 | 2013 | 74786.97978978418 |<br>| 7205 | 2012 | 1957740.046696803 |<br>| 7205 | 2013 | 1064635.647274321 |<br>| 799 | 2012 | 1238.319992542267 |<br>| 799 | 2013 | 940.8999834060669 |<br>| 9115 | 2012 | 26.95999908447266 |<br>| 9115 | 2013 | 23096.43974505365 |<br>| 9909 | 2012 | 1221453.458476434 |<br>| 9909 | 2013 | 628986.4002634082 |<br>+----------+------+-------------------+<br>Returned 38 row(s) in 211.12s</p>\n<p>The query was run on Impala. Table transactions_offers is a join of transactions and offers table on category, company and brand.</p>\n<p>Somehow I do not understand this.</p>",
  "messages": [
    {
      "id": 51541,
      "postDate": "2014-08-03T08:36:58.663Z",
      "content": "<p>I have summed up sales between 3 and 7th months (both months inclusive) of 2012 and 2013 for categories that were put on offer. I find that for a large number of categories there is major reduction in sales volume. Here is the code and data:</p>\n<p>select category, year(dateofpurchase) as year, sum(purchasedfor) from transactions_offers where month(dateofpurchase) between 3 and 7 group by category, year order by category,year limit 90000<br>+----------+------+-------------------+<br>| category | year | sum(purchasedfor)|<br>+----------+------+-------------------+<br>| 1703 | 2012 | 28986.30002164841 |<br>| 1703 | 2013 | 10648.51999127865 |<br>| 1726 | 2012 | 11899.61992621422 |<br>| 1726 | 2013 | 7049.299947738647 |<br>| 2119 | 2012 | 4322.709998846054 |<br>| 2119 | 2013 | 94959.39884486422 |<br>| 2202 | 2012 | 7916.299895346165 |<br>| 2202 | 2013 | 223.5799942016602 |<br>| 3203 | 2012 | 157621.0895465594 |<br>| 3203 | 2013 | 104274.2899192739 |<br>| 3504 | 2012 | 5121.5100055933 |<br>| 3504 | 2013 | 1935.020009160042 |<br>| 3509 | 2012 | 621019.9812324326 |<br>| 3509 | 2013 | 318590.9155675694 |<br>| 4401 | 2012 | 164596.8396745101 |<br>| 4401 | 2013 | 99559.39939513803 |<br>| 4517 | 2012 | 84152.93815687299 |<br>| 4517 | 2013 | 159402.7559259534 |<br>| 5122 | 2012 | 108588.8687553424 |<br>| 5122 | 2013 | 55550.95930415392 |<br>| 5558 | 2013 | 37749.19992566109 |<br>| 5616 | 2012 | 586610.0291579217 |<br>| 5616 | 2013 | 296298.3700178023 |<br>| 5619 | 2012 | 892.3400001525879 |<br>| 5619 | 2013 | 34.8799991607666 |<br>| 5824 | 2013 | 2764.569940200076 |<br>| 6202 | 2012 | 11362.31975889206 |<br>| 6202 | 2013 | 34368.33889818192 |<br>| 706 | 2012 | 140836.3202348445 |<br>| 706 | 2013 | 74786.97978978418 |<br>| 7205 | 2012 | 1957740.046696803 |<br>| 7205 | 2013 | 1064635.647274321 |<br>| 799 | 2012 | 1238.319992542267 |<br>| 799 | 2013 | 940.8999834060669 |<br>| 9115 | 2012 | 26.95999908447266 |<br>| 9115 | 2013 | 23096.43974505365 |<br>| 9909 | 2012 | 1221453.458476434 |<br>| 9909 | 2013 | 628986.4002634082 |<br>+----------+------+-------------------+<br>Returned 38 row(s) in 211.12s</p>\n<p>The query was run on Impala. Table transactions_offers is a join of transactions and offers table on category, company and brand.</p>\n<p>Somehow I do not understand this.</p>"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "51541": ""
  }
}