How to find weekends for various users in a global sales data?

29 views Asked by At

I have a global sales data for various users. Following is an example:-

        Dates       UserId    SalesQuantity
2020-01-01 01:00:00    101    2000
2020-01-01 02:00:00    101    5000
2020-01-01 01:00:00    102    0
2020-01-01 02:00:00    102     4302
2020-01-01 01:00:00    103    5200
2020-01-01 02:00:00    103    0
2020-01-01 01:00:00    104    2400
2020-01-01 02:00:00    104    234

It is almost 2 years of hourly sales data for each user with no null values. No timestamp is repeated for each user. But there can be 0 sales for a given hour. The dates are in UTC format and I don't know to which country does each user belong. Is there a way to find if a given date for a given user is a weekend or a weekday based on the pattern of the sales data?

Initially I thought of considering Friday to Monday next week as possible weekends for a given user and checked data for that user during these days. But then I realized some countries have weekends on Thursday and Wednesdays too. Please guide what things can I possibly try? I am using R to deal with this data.
0

There are 0 answers