Simple Sales Prediction
 
06_sum
20160616
    val a3=d5.groupBy("shop","product").agg( sum("pxy"), sum("pxx") )

Result:

a3.orderBy("shop","product").show()

+----------+-------+-------------------+------------------+                     
|      shop|product|           sum(pxy)|          sum(pxx)|
+----------+-------+-------------------+------------------+
|  megamart|  bread| 1025.6277999999998|142.72660000000002|
|  megamart| cheese|           -83.6016|124.39869999999998|
|  megamart|   milk|  4.699600000000002|          100.0994|
|  megamart|   nuts|  466.9998999999999|             143.0|
|  megamart| razors|           -69.4553|120.90820000000001|
|  megamart|   soap|              -11.0|             110.0|
|superstore|  bread|           596.8173|136.18159999999997|
|superstore| cheese|0.39890000000000114|          128.8991|
|superstore|   milk|-2.5002999999999993|          104.0996|
|superstore|   nuts|         -2096.0004|             143.0|
|superstore| razors|-285.00030000000004|             143.0|
|superstore|   soap|           -11.0003|             110.0|
+----------+-------+-------------------+------------------+
 
Notes by Data Munging Ninja. Generated on nini:/home/willem/sync/20151223_datamungingninja/simplesalesprediction at 2016-06-25 10:02