Questions tagged [count]

0 votes
1 replies
A better way to group and count multiple columns SQL
I have a survey table that shows the answers that people have taken once a month when they enter a contest. I'm trying to find a better way to...
asked 4 months ago
0 votes
2 replies
How to get BASH array length with descriptive/readable statement?
It seems like the standard way to get the length of an array in BASH is with ${#myArray[@]}, like so: myArray=( 1 3 5 7 9 ) length=${#myArray[@]...
asked 4 months ago
0 votes
3 replies
Counting how many times a value occurs inside an array grouped under another value (years)
I have an array with some information in it. There are two important keys datum and answer. This is my array: Array ( [0] => Array...
asked 4 months ago
1 votes
1 replies
Any way to do simple count of relations with different 'where' clauses?
I have this relation in User model public function bulletins() { return $this->hasMany('App\Bulletins','owner'); } in controller I ge...
asked 4 months ago
-2 votes
2 replies
MySQL - SELECT COUNT(*) AND IGNORE SAME ID
As per the title, I want to count rows in a table but if multiple rows got same ID, should count them as ONE ROW. For example, I have a table na...
asked 4 months ago
0 votes
1 replies
In Postgresql, I counted/aggregated inventory based on part numbers, but want the query to only return results about a threshhold volume
For my company, I am writing a query that is aggregating/counting our inventory by part number. This works well and returns a data set that show...
asked 4 months ago
-1 votes
0 replies
Count rows by time period with data.table in r [closed]
I'm trying to count rows by time period(30days) with data.table in R I have dt like below : library(data.table) dt <- fread(" ID DATE...
asked 4 months ago
0 votes
1 replies
Is there an easier way to do this problem without using so many if statements? and how?
We were given a problem that asks to use the letters QDN(Quarter, Dime, Nickel) to create a finite state machine that only accepts if they add to...
asked 4 months ago
0 votes
2 replies
Neo4j count increases execution time substantially and runs out of memory
I am using Neo4j to store data regarding movie ratings. I would like to count the number of movies that two users both rated. When running the qu...
asked 4 months ago
0 votes
0 replies
How to count the number of entries that have 2 same characteristics?
I need to calculate the number of entries in a dataset that have the same year and location (city) and add a column for the sum, like the example...
asked 4 months ago
0 votes
2 replies
count number of unique elements in a given column after filtering in R
Lets say I have a data table like: year city 2026 NYC 2026 NYC 2026 NYC 2026 LA 2027 LA 2028 NYC 2028 NYC Which can be created by: dt...
asked 4 months ago
0 votes
3 replies
COUNT monthly sales for every year
I need to check monthly sales (count not sum) by area for long ranges of dates (5+ years), something like a excel pivot table, currently I'm work...
asked 4 months ago
1 votes
2 replies
How to use Count with Case When?
I am trying a Query to get Env between 2 dates. If there is more than 1 value in the table : display error' else display the value of Env. I a...
asked 4 months ago
1 votes
3 replies
compute frequencies for groups of variables
I want to compute the frequency of the modalities according to the species found. Here is the data frame, and I want to count the number of each...
asked 4 months ago
0 votes
0 replies
Count of a Range
I, more or less, want to make a histogram of a table of percentages. At the moment, I'm coding it up like this: Sum( Case When...
asked 4 months ago
0 votes
0 replies
How to determine the number of touches in PinchWithGestureRecognizer method in macOS
In iOS, we get touches from pinchGestureRecognizer.NumberOfTouches. How can we get the touches count in macOS during pinch zooming 0 0 Answ...
2 votes
1 replies
Creating a count table based on each value in each column in R
I have a data table that begins like this: test <- data.frame("AZ" = c("ABCD, AAAA, BBBB"), "AK" = c("ABCD"), "NJ" = c("BBBC", "AAAA"))...
asked 4 months ago
0 votes
2 replies
COUNT with IF FROM DISTINCT values MySQL
I am trying to calculate the how many users are female and how many male, after doing DISTINCT on the UserID SELECT COUNT(IF("Gender" = 'female'...
asked 4 months ago
0 votes
1 replies
Show image based on checkbox selection
I am trying to create a selection of different checkboxes that should show content based on the selections that are chosen. I managed to create s...
asked 4 months ago
0 votes
0 replies
Is there a way to count unempty cells in excel vba
I need help with the below. Everything works in the code just fine except this part For j = i + 1 To i + 4 Cells(j, 9) = Cells(j, 9) + Abs(Cell...
asked 4 months ago
0 votes
0 replies
Count blank cells for specified criteria
I'm looking for formula in Excel that will allow me to count blank cells with added criteria. SOURCE TABLE: Brand Scanned Brand1 Brand1...
asked 4 months ago
0 votes
1 replies
Mongoose populate count
I want to know how many users are associated to my office and for this I use the count option for virtual schema. Office schema: const OfficeSc...
asked 4 months ago
2 votes
1 replies
Symfony 3 - Doctrine - Difficulties on big query
I'm annoyed because of a big query that goes a little in all directions. She will use several tables: User Package User Type PackageDDLExterna...
asked 4 months ago
0 votes
0 replies
Python number of rows by group and assign into a new column [duplicate]
I have this simple dataframe df: df = pd.DataFrame({'c':[1,1,1,2,2,2,2],'type':['m','n','o','m','m','n','n']}) my goal is to count values of t...
asked 4 months ago
1 votes
3 replies
Explode and Count all items from 2 dates column
I would like to get all possible date (in this case : event_day) and number of event that happen between start_date and end_date. please look tab...
asked 4 months ago