Q22Y36T4TRTOAYVINNLCVV6NIR3WGW6IHY7QHUTX6PITRCPLZZQQC
p1 = df |> @vlplot(:bar, height=800, width=800,x={:how_often, axis={title="How often do you use a pack?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("how_often.png", x)
p1 = df |> @vlplot(:bar, height=700, width=700, config={axis={
labelFontSize=22, titleFontSize=26},scale={fontSize=22}}, x={:how_often, axis={title="How often do you use a pack?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("how_often.png", x)
p2 = df |> @vlplot(:bar, height=800, width=800,x={:where, axis={title="Where do you use your pack most?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("where.png", x)
p2 = df |> @vlplot(:bar, height=700, width=700, config={axis={
labelFontSize=22, titleFontSize=26},scale={fontSize=22}}, x={:where, axis={title="Where do you use your pack most?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("where.png", x)
p3 = df |> @vlplot(:bar, height=800, width=800,x={:what, axis={title="What kind of load do you carry?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("what.png", x)
p3 = df |> @vlplot(:bar, height=700, width=700, config={axis={
labelFontSize=22, titleFontSize=26},scale={fontSize=22}}, x={:what, axis={title="What kind of load do you carry?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("what.png", x)
p4 = @vlplot(:bar, height=800, width=800,x={make, axis={title="What is your all time most used pack?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("most_used_make.png", x)
p4 = @vlplot(:bar, height=700, width=700, config={axis={
labelFontSize=22, titleFontSize=26},scale={fontSize=22}}, x={make, axis={title="What is your all time most used pack?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("most_used_make.png", x)
p5 = @vlplot(:bar, height=800, width=800,x={size, axis={title="Size of most used pack?"}, sort="-y", bin={maxbins=6}}, y={"count()", axis={title="Count"}}) |> x -> save("most_used_size.png", x)
p5 = @vlplot(:bar, height=700, width=700, config={axis={
labelFontSize=22, titleFontSize=26},scale={fontSize=22}} , x={size, axis={title="Size of most used pack?"}, sort="-y", bin={maxbins=6}}, y={"count()", axis={title="Count"}}) |> x -> save("most_used_size.png", x)
p6 = @vlplot(:bar, height=800, width=800,x={most_important, axis={title="What is most important in a pack?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("most_important.png", x)
p6 = @vlplot(:bar, height=700, width=700, config={axis={
labelFontSize=22, titleFontSize=26},scale={fontSize=22}}, x={most_important, axis={title="What is most important in a pack?"}, sort="-y"}, y={"count()", axis={title="Count"}}) |> x -> save("most_important.png", x)
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))
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),
)
save("/media/david/SSD1/FiordlandPacks/images_and_tables/metrics_fiordland_packs.png")
end
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
),
)
c = get_traffic(current, days)[!, 2] |> x -> Indicators.sma(x, n=7) |> x -> last(x, days) |> x -> round.(x, digits=1)
p = get_traffic(last_year, days)[!, 2] |> x -> Indicators.sma(x, n=7) |> x -> last(x, days) |> x -> round.(x, digits=1)
c = (x -> (x -> (x -> round.(x, digits=1))(last(x, days)))(Indicators.sma(x; n=7)))(
get_traffic(current, days)[!, 2]
)
p = (x -> (x -> (x -> round.(x, digits=1))(last(x, days)))(Indicators.sma(x; n=7)))(
get_traffic(last_year, days)[!, 2]
)
plt = lineplot(collect(-days:-1), [c p], color=[:blue :yellow], title="Unique Visitors: 7 day moving average", name=["Last $days Days", "Last Year"], xlabel="Day", ylabel="Visitors", canvas=DotCanvas, border=:ascii)
plt = lineplot(
collect((-days):-1),
[c p];
color=[:blue :yellow],
title="Unique Visitors: 7 day moving average",
name=["Last $days Days", "Last Year"],
xlabel="Day",
ylabel="Visitors",
canvas=DotCanvas,
border=:ascii,
)
vcat(DataFrame("Days" => collect(-days:-1), "Visits" => c, "Period" => "Last $days Days"), DataFrame("Days" => collect(-days:-1), "Visits" => p, "Period" => "Previous Year")) |>
@vlplot(
:line,
x = :Days,
y = :Visits,
color = :Period,
title = "Unique Visitors: 7 Day Moving Average",
width = 400,
height = 400
) |>
save("/media/david/SSD1/FiordlandPacks/images_and_tables/visits_fiordland_packs.png")
end
save(
"/media/david/SSD1/FiordlandPacks/images_and_tables/visits_fiordland_packs.png"
)
end(
@vlplot(
:line,
x = :Days,
y = :Visits,
color = :Period,
title = "Unique Visitors: 7 Day Moving Average",
width = 400,
height = 400
)(
vcat(
DataFrame(
"Days" => collect((-days):-1),
"Visits" => c,
"Period" => "Last $days Days",
),
DataFrame(
"Days" => collect((-days):-1),
"Visits" => p,
"Period" => "Previous Year",
),
),
),
)
function get_custom_events(end_date::Dates.Date, event::String, days::Int=7, SITE_ID::String="fiordlandpacks.nz")::@NamedTuple{Event::String, Number::Int64}
function get_custom_events(
end_date::Dates.Date, event::String, days::Int=7, SITE_ID::String="fiordlandpacks.nz"
)::@NamedTuple{Event::String, Number::Int64}
e = replace(event, "+" => " ") |> x -> titlecase(x)
isempty(df) ? (return (Event=e, Number=0)) : (return (Event=e, Number=first(df.visitors)))
e = (x -> titlecase(x))(replace(event, "+" => " "))
if isempty(df)
(return (Event=e, Number=0))
else
(return (Event=e, Number=first(df.visitors)))
end
function get_pageview_events(end_date::Dates.Date, event::String, days::Int=7, SITE_ID::String="fiordlandpacks.nz")::@NamedTuple{Event::String, Number::Int64}
function get_pageview_events(
end_date::Dates.Date, event::String, days::Int=7, SITE_ID::String="fiordlandpacks.nz"
)::@NamedTuple{Event::String, Number::Int64}
e = replace(event, "_" => " ") |> x -> titlecase(x)
isempty(df) ? (return (Event=e, Number=0)) : (return (Event=e, Number=first(df.visitors)))
e = (x -> titlecase(x))(replace(event, "_" => " "))
if isempty(df)
(return (Event=e, Number=0))
else
(return (Event=e, Number=first(df.visitors)))
end