EBCFJS2FNWXWJ6PPMFR3G54LR2THVYXTFST7SLZEOTA2YEPUQ3QAC
Q22Y36T4TRTOAYVINNLCVV6NIR3WGW6IHY7QHUTX6PITRCPLZZQQC
A7ZUWLHKSGJGSST76DHHV7M54N3M5Z3BPSC7IWDO4FOZUBNQ2SHQC
LTNUXR5DQYU2RRAAWWZRPBJTHHNGXA4YAWESL3EWFSAQTBYJ5NBAC
IYLVG2FIKHIV7PDJ6KNSGAJZ7PIKMO4D3GPL3JQASS3AL2MQYOXAC
K4V5O6JXK2IVDQE4BV7OIJXFAM7GMHRXDBXI3QCDNELI3JSHLBVQC
3EZS3IU6VKUGYH3TKTKGIAK2QIHZLZTVFAQCCTCEOT2ME3GP3DIQC
function metrics_plot()
if Sys.isapple()
file = "/Users/david/julia/FiordlandPacks/images_and_tables/FiordlandPacks.csv"
else
file = "/media/david/SSD1/FiordlandPacks/images_and_tables/FiordlandPacks.csv"
end
df = DataFrame(CSV.File(file))
transform!(df, [:Shopify_Sales, :Invoice_Sales] => (a, b) -> a .+ b)
select!(
df,
:Week,
:Contact_Submit,
:Pack_Builder_Clicks,
:Checkouts_Created,
:Customer_Actions,
:Shopify_Sales,
:Invoice_Sales,
:Shopify_Sales_Invoice_Sales_function => "Sales",
:Google_Spend,
)
table = pretty_table(
last(df, 12);
title="Metrics",
header=[
"Week",
"Contact",
"Builder",
"Checkout",
"ACTIONS",
"Shopify",
"Invoice",
"Sales",
"Google",
],
display_size=(30, 300),
)
df2 = Base.stack(df, [:Customer_Actions, :Sales, :Google_Spend])
transform!(df2, :Week => ByRow(x -> Dates.format(x, "yyyy-mm-dd")))
rename!(df2, :variable => "Metric", :value => "Number")
if Sys.isapple()
save(
"/Users/david/julia/FiordlandPacks/images_and_tables/metrics_fiordland_packs.png",
)
else
save(
"/media/david/SSD1/FiordlandPacks/images_and_tables/metrics_fiordland_packs.png"
)
end(
@vlplot(
:line,
x = :Week,
y = :Number,
color = :Metric,
title = "Metrics Plot",
width = 400,
height = 400
)(
df2
),
)
return table
end