21,698 questions
0
votes
1
answer
30
views
MySQL: get daily count of items which have a start_date and an end_date
I do have tours in a table which do have a start date and an end date, e.g.
id | start_date | end_date
1 2025-06-13 2025-06-13
2 2025-06-12 2025-06-17
3 2025-06-20 2025-06-21
4 ...
-3
votes
0
answers
19
views
How get a sql query of Result Table? [closed]
I use Sql Server make a table name is dbo.Taleem , my table faced issue when count of result of a sql query based a value with null
My Table here:
but I Need Summary of this dbo.Taleem, so I cannot ...
1
vote
1
answer
53
views
Add column count of occurrences
I have table in SQL Server called df found here:
-- Parameters
DECLARE @Year INT = 2020; --, @Country varchar(50)= 'Brazil';
WITH ModeData AS (
SELECT country,
a.Mode
FROM df
...
1
vote
2
answers
38
views
Get all data COUNT fastest from large table based on condition
I have the table with 10TB of data.
I want to perform the COUNT(1)/COUNT(*) to check the EXACT COUNT between main table and archive table.
I tried following SQL's but didn't get optimal solution, ...
3
votes
4
answers
79
views
Analysing several columns of a dataset at the same time
I work with a real large dataset, where it is very difficult to look at all columns individually.
At this time I only want to count the frequency of the information provided.
Lets say I have a ...
0
votes
0
answers
14
views
Analyzing count data appropriately [closed]
I have a statistical question that seems easy, yet I can't find an appropriate way to deal with it:
In one dataset containing 8499 individuals, we counted the number of arrhythmias (irregular heart ...
1
vote
3
answers
53
views
How can I count cominations of variables in R?
I'm trying to count the number of occurrences of combinations across two variables in a data frame in R.
If I have the following dataframe:
df <- data.frame(v1 = c("A", "A", &...
0
votes
0
answers
36
views
Why am I getting blank rows from CASE expressions when first expression returns value [closed]
I am attempting to write a query that uses multiple "CASE WHEN" to count instance for different categories.
What I have now is this:
SELECT COUNT(CASE WHEN customer_feedback = "Very Bad&...
0
votes
1
answer
11
views
How to create a variable from count of instances of an existing variable in SPSS
I want to create a variable that is the count of instances of a certain year in my dataset in SPSS. To be more specific, I am analyzing the number of suicides before and after 1996. I have a data set ...
3
votes
1
answer
65
views
Is there a table function in R that summates a referenced column?
I have a data frame similar to the example data frame below:
example = data.frame(
freq = c(22,1,12,4,8,76,55,43,1,34),
x=c("FALSE","FALSE","TRUE","FALSE",&...
1
vote
0
answers
26
views
Counting Issue in Tableau
I am working with a live data stream in Tableau and don't have any control over the data. I am encountering an issue where I am getting two different values that should be the same. The first count is ...
1
vote
1
answer
46
views
Looping over Pandas columns while counting rows that contain two specified values
I am trying to count each row in Pandas dataframe that contain two specified values, but the problem is that the values can be in any column. How can I loop the part with;
for col in con.columns:
...
3
votes
4
answers
107
views
Count elements in a row and create column counter in pandas
I have created the following pandas dataframe:
import pandas as pd
ds = {'col1' : ['A','A','B','C','C','D'],
'col2' : ['A','B','C','D','D','A']}
df = pd.DataFrame(data=ds)
The dataframe looks ...
0
votes
2
answers
79
views
Mutiple Distinct Record Count from TWO tables having different value need to be matched and reported if there is a difference
I want to compare the count of DELIQUENCY_COUNT=0 with the count of CYCLE_DELIQUENCY = A and Count of DELIQUENCY_COUNT=1 with count of CYCLE_DELIQUENCY = B and so on.
If the count is different a ...
0
votes
1
answer
27
views
How to use Count in a Pivot clause
I'm using Oracle 21C.
My query involves three tables that can be created with the following code:
Create Table vol_att
( prim_key integer NOT NULL,
event_fkey integer,
contact_fkey integer,
...
0
votes
3
answers
64
views
R newbie: R equivalent to SAS proc sql, group by, having, count, remerging summary statistics
In SAS i write a code that in the log looks like:
2 proc sql;
3 create table test as
4 select
5 ID,
6 GENDER,
7 BIRTHYEAR
8 from
9 libname.dataset
10 group by ID
11 having ...
0
votes
0
answers
19
views
How do I create a data frame that is a count based on two variables? [duplicate]
My data would look like this:
Gender
Age range
M
0-10
F
10-20
M
0-10
F
10-20
I want to produce a summary table that would look like this:
Gender
0-10
10-20
M
2
0
F
0
2
Really struggling to ...
1
vote
1
answer
80
views
Count distinct values in multiple XML-files with XQuery/XPath
I have several XML-files, which all have the same structure. I need to find all the distinct values that occur in each element and count each distinct occurrence.
What is the best way of doing this?
I’...
0
votes
0
answers
60
views
Adding two-way fixed effects for zero inflated Poisson model
I am working with a zero inflated Poisson model. I am using the glmmTMB
My outcome variable is the number of burglaries in all of Texas between 2000 and 2015. My unit of analysis are counties (county)....
1
vote
2
answers
65
views
R data frame count consecutive days with condition = 0
I would like to count the maximum number of consecutive rows = 0 per year, for each column of the data frame.
I try this but it works for each column separately:
library(data.table)
data <- data....
0
votes
0
answers
34
views
given N sequences and a consensus, count how many sequences agree with the consensus per position [duplicate]
I have 3 aligned sequences and a consensus sequences:
aln_seqs <- c('CCCGNGGGAGANAGACTGAGTCTGTGATATACACATCAGAATCCTTACTTTGTGACACATTTGTTTGAGA','CCCGGGGGAGAAAGNTTT-...
0
votes
1
answer
45
views
Counting Measures in DAX in Power BI
I have a visualization in Power BI that reflects the category of a customer based on their market share. The market share is a DAX Measure which changes dynamically based on the selections in slicers (...
0
votes
0
answers
30
views
Count Characters in Column in csv in RStudio [duplicate]
My dataset is being read from a csv file that has 101,777,660 entries, 3 total columns. I am trying to count the number of times these five layers/words occur in the third column (ORIG_NAME): "...
-1
votes
1
answer
27
views
compare the counts between two years
I am trying to report on comparing record counts between current and past years. I tried the samelastyearperiod function and the dateadd function, but I haven't had any luck. Can you please help me? ...
0
votes
2
answers
72
views
Use of conditionals with group_by
I have a dataframe XYdata and I need to count per participant (ppt) and item (item) if there is any value in column Time (Time). If there is no value there, it means that all rows for that participant ...
1
vote
1
answer
48
views
Avoiding overlap in frequency and document frequency count in Quanteda
Below is a dummy corpus of 4 documents.
The dictionary was developed to identify the frequency of words or phrases in the corpus, as well as the number of documents a word or phrases occurs in.
The ...
-3
votes
1
answer
55
views
How to add another column to a previous calculation showing frequency of values per year per month using dplyr in R [duplicate]
Issue
I have a large data frame (388 x 729) and I am trying to calculate the frequency of new daffodil bulbs (numeric column) per month (factor column) per year (numeric column) over 14 years.
I have ...
0
votes
1
answer
55
views
COUNT where SUM condition using DQL
According to our club's membership database, some members are in arrears.
In the simple example below, in the first year, Marc and Paul paid their membership dues, while Denis credited his account.
In ...
1
vote
1
answer
41
views
Counting all "-1" and -1 in a dataframe for a list of certain columns
I have a polars dataframe, and for some of the columns I want to count the number of "-1" (if character) and -1 (if numeric). I would like to really make this a fast query, so I'm very ...
1
vote
1
answer
60
views
Quanteda overlap frequency reporting problem
I’m hoping to identify an apparent miscalculation due to overlapping terms.
In the dummy data set and code below, which uses the same code on the actual data, the analysis works as expected. “...
2
votes
2
answers
138
views
How can I stop my count if the timer hits 00:00?
I am currently programing an app as a project. While doing so I just got into Javascript yesterday and I am having an issue to stop my count.
What is my program doing:
You can see an image, which you ...
-1
votes
1
answer
74
views
Getting a count dynamically for Customers first time orders and also orders lost after last order date + 4 months, per year and month
I am trying to dynamically get a count at a per month basis per customer and type. Where two of the counts are the first time we got an order based on the program and the other two are programs/...
0
votes
1
answer
42
views
how to find duplicate results in elasticsearch 6
I had an elasticsearch with version 6, now I need to find duplicate documents in a index "es_index" by field "userName" with same field value. That means I need to write query like ...
0
votes
1
answer
67
views
How select query from record count more than 1 and count more than 2 with custom column (Option) in MS Access
I'm trying to select query from record count more than 1 (ID&DATE&INOUT) and count more than 2 (ID&DATE) with custom column (Option) in MS Access
so with "NO" in the option ...
0
votes
1
answer
25
views
Google Sheets: Formula requires Complex Logic regarding dates
I have a spreadsheet with four data columns, and a reference date:
I am trying to:
Count the number of people who are Members,
AND who were younger than 16 on B1,
AND who did not die before B1.
For ...
0
votes
0
answers
15
views
Maximum Count of Subarray having sum >= k and length >l
For a given array we need to find the maximum number of subarrays possible. Conditions:
1.The sum of each subarray should be >= minSum
2.The length of the subarray should be >= minLen
We need to ...
0
votes
1
answer
35
views
Power BI - Show Counts for last 7 days including zeros
I am trying to count occurrences of a QR code entry in to a DB each day and display the last 7 days of counts. I would like to include zero counts.
The top graph is using QR Code (count) for the Y ...
0
votes
1
answer
78
views
Count Red Cells In Userform Display
I have a UserForm that displays and verifies data. If the data is not accurate the forecolor will turn red.
Because there is so much data to verify I would like a textbox on the first page that will ...
0
votes
2
answers
63
views
How can I hide the total count in changelist_view (Django admin)?
I want to hide the total displayed in changelist_view, as in the following image.
Django admin screen
I searched but couldn't find any way through admin customization.
I know I can modify the template,...
0
votes
1
answer
20
views
Count occurencies with multiple criteria from dataframe
I have a dataframe from a large excel sheet with patient data outcomes that includes 20+ columns and thousands of rows. I would like to take out statistics based on multiple criteria. I would like to ...
1
vote
1
answer
43
views
How to add a COUNT column as a subquery in MySQL
Hello I have 2 tables:
purchase_info
purchase_items
There's a view in which I display a summary of the purchase and I would like to count how many items belong to certain purchase.
How do I achieve ...
-1
votes
1
answer
55
views
Why does CountA give me more results than using FILTER with either NOT(ISBLANK or <>""
If i do countA on a columnA of sheet1 it says 899 results.
If on sheet2 I do either of
=FILTER('sheet1'!A6:A5826,'sheet1'!A6:A5826<>"")
or
=FILTER('sheet1'!A6:A5826,(NOT(ISBLANK('...
1
vote
1
answer
57
views
How can I create a separate count for supplementary figures?
For my thesis, I would like to have the option to count supplementary figures separately, but be able to mention them within the main text, without showing them.
If I simply add a figure in my ...
1
vote
2
answers
50
views
In R, how do you find the number of different values between 2 character strings?
I'm trying to see the number of new employees a manager got between time one and time 2. I have a string of all employee ids that roll up under that manager.
My below code always says there is 1 new ...
2
votes
2
answers
57
views
How to count if a product is bought on the same day, by the same person, together with another product?
I've been browsing multiple different places to try and find an answer but I think I'm likely too thick and/or over simplifying how Excel works.
What I'm trying to get is hopefully a matrix, unless ...
0
votes
1
answer
54
views
EXCEL Sumproduct COUNT 2 AND condition every nth COLUMN, counting blank and not blank
Good Day to all! as my title suggest I am having a problem with the sumproduct formula to get the result that for the following condition
Check and Count every 4th column range for NOT blank ...
0
votes
2
answers
62
views
MergingTwo SQL Queries Select and Count in Single statement
I am Working on project, where I am using two queries to get the result i wanted to process.
Query 1
SELECT MID FROM PMS.MACHINE WHERE STATUS=1 AND MID !=0;
Query 2
SELECT MID,COUNT(STATUS) AS QUEUE
...
1
vote
5
answers
126
views
How to count the total entries by group when they are comma-separated
I'm working with the League of Legends Champions dataset
name
tags
Aatrox
Fighter
Ahri
Mage,Assassin
Akali
Assassin
Akshan
Marksman,Assassin
Alistar
Tank,Support
And I was wondering how to ...
0
votes
0
answers
22
views
COUNT(DISTINCT <col>) without GROUP BY
In Django, Count("col", distinct=True) can be used to perform COUNT(DISTINCT col) but it automatically adds a GROUP BY so is there a way to prevent that from happening so the distinct count ...
0
votes
0
answers
25
views
Django annotation based on Count not working, always return 1
In models.py I have defined:
class Order(models.Model):
...
class Operation(models.Model):
order = models.ForeignKey(Order, on_delete=models.CASCADE, related_name="operations")
....