I am using Mathematica to analyze some sales data for my company. (A copy of the available data is here.) We are trying to analyze the sales trends for each month by item.
DateListPlot works well with individual items, but I have not found a way to plot multiple data sets (i.e., different products) on one plot. We sell several thousand products, so being able to only view one product at a time is rather cumbersome. Since we didn't start selling all of our products at one time, the start dates are different for many of our items.
Can I use DateListPlot to plot multiple data sets with different start times?
(...if not, does anyone have any good alternatives?)
(Working) code:
(* This notebook is designed to find out our most popular products, both in total and in relation to time. *)
ClearAll; (*Clear out any stale variables. *)
data = Import[
"C:\\Users\\sales\\Documents\\Marketing\\Data\\CSV-MMA.csv"]; (* Organize \
and manipulate our data to make it simpler. *)
data = Delete[data, 1];
data = SortBy[data, data[[All, 1]]];
data = Split[data]
data = Flatten[data, 1];
data = Drop[data, {2, 4}];
data = SplitBy[data, First];
f[q_] := Sort@(Flatten@{#[[7]], #[[1]], #[[2]], #[[4]], #[[5]], #[[6]]} & /@
data[[q]]);(* Here we sort our data further. After this, it should be \
ready for graphing or grid analysis. *)
multiPlot[c_] :=
DateListPlot[c[[All, 6]],
DateString[c[[All, 1]][[1]], {"Month", "/", "Year"}],
PlotLegends -> c[[1]][[3]], PlotTheme -> "Marketing"]
q[z_] := d[f[data, z]];
d = Map[f, {1, 2, 3}];