| Simple Sales Prediction
| |
|
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|
+----------+-------+-------------------+------------------+
| |