Count/Sum Distinct in Google Studio - google-analytics

I have physical and injury data and I'm looking to show the amount of days missed for each injury. I have an Injury Column that shows the region of injury (Knee, Ankle, Foot, etc), a Diagnosis Column (MCL Sprain, Ankle Tear, Foot Fracture, etc) and a Time Missed (Days) Column. However I want to show the number of days missed for each specific injury in a bar chart on Google Studio. For example Player 1 Missed 29 days because of a Knee Injury, however, later on in the year he suffered another Knee Injury but this time only missed 10 days. At the moment Google Studio sums the two so the bar chart shows that he missed 39 days due to a Knee Injury. Count Distinct did not work. Any ideas?

Count Distinct is for counting distinct data.
You have 2 dimensions (Play Name and Region of Injury) and 1 date range (Year).
You need to set:
breakdown dimension, the default aggregation would sum for you
a controll
To summarize:
Dimension: Player Name
Breakdown Dimension: Region of Injury, Year
Metric: Time Missed
Control: Drop-down list, or Date range control with Year to be the control field

Related

Daily count of individuals detected by each monitoring station

I have a ver large (2+ years) data set of acoustic telemetry data. The study is based on constantly monitoring several animals fitted with an acoustic tag, using stations throughout the study area to detect them.
I want to obtain a summary table that shows the number of individual tags detected by each station per day (e.g.,"on 2019-04-02, five tags were detected at station 1, three tags at station 2"). Other time frames interest me too but a daily count is the most relevant right now.
I haven't worked with R for long, so I'm having a hard time coming up with this kind of code. I don't really have anything useful to show. I have several individuas and stations, but below is an example of how the data looks like (already dropped time of day).
Thanks,
Date.and.time Station Transmitter
2019-04-02 Station_3 Tag_1
2019-04-02 Station_26 Tag_3
2019-04-02 Station_3 Tag_13
2019-04-02 Station_15 Tag_15
.
.
.
2021-10-14 Station_13 Tag_20
2021-10-15 Station_8 Tag_8
2021-10-15 Station_23 Tag_31

Netsuite saved search formula that sums distinct values within a date range

I am trying to create a saved search of time entries in Netsuite.
Under criteria, I have specified a date range. This varies as this is an available filter
For the purposes of this example, the date range is 1/4/2020 to 10/4/2020
The first column ('Total Customer Billable Hours') in this sums all time entries that are coded against project task type 'billable project'. The formula I am using for this:
Formula (Numeric), sum, Case when {project.task_type}='Billable' then {durationdecimal} else 0 end
For the second column, I want the sum of hours the employee would normally work (in the time period specified under criteria-1/4/2020 to 10/4/2020 in this example)
The formula I am using to sum this is
Formula(numeric), sum, {timesheet.workcalendarhoursdecimal}
However, this is multiplying the employee's weekly hours by the number of time entries that make up the 'Total customer billable hours' figure
i.e. if an employee works a 40 hour week, the formula is multiple 40 x 36 (the number of time entries that make up the customer billable figure for example)
What would the correct formula be so that the second column is only summing the employee's work calendar hours for the period specified in the criteria/available filter selection?
Try changing sum to maximum:
Formula(numeric), maximum, {timesheet.workcalendarhoursdecimal}

why %new sessions by month differs from averaging %new sessions by each day of that month

I have the following problem,
I want to see the percentage of new sessions in a given month. I am specifically interested in new sessions by "direct" channelgrouping
in custom report I set dimensions for November: yearMonth, source, medium, channelgrouping. and metrics:percentNewSessions
it gives me 35%
then I create a custom reports with the same dimension but with Date as a metric.I average the %new session and get 38%
why does it differ? What should I trust?
Both of these measures are true, but they tell something different.
Another simple use case with date metric:
Day 1: visitor A
Day 1: visitor B
...
Day 7: visitor A
Day 7: visitor C
— Week unique visitors: 3
— Week sum of daily unique visitors: 4
Define your KPI, what is measured, how it is measured, the period for measurement, and always stick with the KPI parameters; else you're on another one :)

Statistical analysis on daily data

I have a number of data points that I am trying to extract a meaningful pattern from (or derive an equation that could then be predictive). I am trying to find a correlation (?) between RANK and DAILY SALES for any given ITEM.
So, for any given item, I have (say) two weeks of daily information, each day consists of a pairing of Inventory, and Rank.
ITEM #1
Monday: 20 in stock (rank 30)
Tuesday: 17 in stock (rank 29)
Wednesday: 14 in stock (rank 31)
The presumption is that 3 items were sold each day, and that selling ~3 a day is roughly what it means to have a rank of ~30.
Given information like this across a wide span (20,000 items, over 2 weeks) of inventory/rank/date pairings, I'd like to derive an equation/method of estimating what the daily sales would be for any given rank.
There's one problem:
The data isn't entirely clean, because -occasionally- the inventory fluctuates upward, either because of re-stocking, or because of returns. So for example, you might see something like
MONDAY: 30 in stock.
TUESDAY: 20 in stock.
WEDNESDAY: 50 in stock.
THURSDAY: 40 in stock.
FRIDAY: 41 in stock.
Indicating that, between Tuesday and wednesday, 30 more were replenished, and on thursday, one was returned.
I am planning to use mean and standard deviation on Daily sales for given rank.
So if any rank given I can predict the daily sales based on mean and standard deviation values.
Is this correct approach? IS there any better approach for this scenario
Sounds like this could be a good read for you, fpp
It provides an introduction to timeseries forecasting. Timeseries forecasting
has a lot of nuance so it can trip people up pretty easily. Some of the issues
you have already noted (e.g. seasonality). Others pertain to the statistical
properties of such series of data. Take a look through this and

Working with imperfectly matched data in crossfilter

Given the following dimensions specifications in Crossfilter's API - https://github.com/square/crossfilter/wiki/API-Reference
1.) The function must return naturally-ordered values
2.) .....incomparable values such as NaN and undefined are not supported
How would one go about charting a crossfilter (using dc.js) with two dimensions - one with daily data (7 days a week), and another with business-day data (5-days a week)? The data structure implies that the business-day data will have gaps on the weekend which should violate the specifications above.
For example, if I want to compare a company's store sales (7 days/week) vs its stock price (5 days + gaps on Saturday and Sunday), how would i go about it? The goal would be to have two dc.js charts filtering each other, but having data that isn't perfectly matched up i.e. the first chart will show sales data from Jan 1 till Jan 31 (7 days a week), while the second chart will show stock price data from the first till the last business day in Jan (excluding weekends).
Your stock data would likely include no data for Saturday and Sunday. This is is different from having a data row with stock price as NaN.
For example: If you plotted the stock data on a row chart with the days of the weeks for the categories, then there would be no bars for saturdays and sundays.
Here is a crude example: DC.JS example of days of week chart
I made sure that no rows were added for saturdays and sundays:
if ((stockDate.getDay() != 6) && (stockDate.getDay() != 0))
The resulting row chart has no row for Saturday or Sunday.
You could explore filtering your data, as I did, so you preselect what you want to show. Remember to include the additional code which preserves the bins.
Hide Specified Row in dc.js rowchart

Resources