Data Sorting Question

Hi all!

First time user here so forgive me if I'm asking my question in a weird way or if I'm asking in the wrong topic. But I am having an issue with a code to pull multiple points from a dataset in a lump sum.

I'm trying to sum all net sales from a different control point on certain date. I was able to get a line of code to work that gave me the sum of all net sales at a control point:

sum(e$Net.Sales[(e$Price.Point.Name=="go")&(!is.na(e$Price.Point.Name))])

my hiccup is trying to incorporate the date variable. I tried doing something like:

sum(e$Net.Sales[(e$Price.Point.Name=="Pint")&(!is.na(e$Price.Point.Name)), which(e$Date=="1/4/2019")])

but with no success.

Any advice or direction??

-Ratt

library(dplyr)

e %>%
  filter(Price.Point.Name=="Pint",Date=="1/4/2019") %>%
  summarise(total=sum(Net.Sales))

Thank you so much! I wish you the best and wish I could by you beer
-Ratt

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.