645
questions
-1
votes
3
answers
110
views
SQL unique values for one column
I have data composed of three columns. I would like to get distinct values for 2 columns only (ID, value).
Here is my data:
enter image description here
I would like to have this desired result:
enter ...
0
votes
1
answer
61
views
How to divide the values in a single line into multiple lines, and also to remove the duplicates in xslt 3.0
Input:
<AAA>RIO_CBI_TE01_1 RIO_CBI_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 RIO_ATC_TE01_1 &...
0
votes
1
answer
37
views
How to insert nodes based on matches and node quantities
I have a xml structure like this:
<nc>
<mod>
<grp id="d0e9f2f84">
<des>GROUP_33</des>
<num>--33</num>
...
1
vote
4
answers
102
views
How to get string with disctinct (unique) characters from existing string in bash script?
For example, I have string:
explicit_borders="\"\"''()"
How to calculate based on this string the string with the following result:
distinct_border_chars="\"'()" # ...
0
votes
0
answers
22
views
XLS select from .csv file, distinct values
I am am builidng an xls form for student attendance data collection. I am using the pulldata function to pull in the options for selecting students from an external .csv file. However, there are ...
-1
votes
2
answers
88
views
(Excel Mac) COUNTIF ID# is number and listed only once per date
I have 60,000 rows of data where I just pulled out the dates, added columns for day of the week, and have ID #s for each row. Blank ID # cells wouldn't be counted. I need to find the total count by ...
0
votes
2
answers
66
views
Distinct countifs of IDs
I have the following table:
ID
Month num
Year
1
1
2024
1
1
2024
2
2
2024
1
2
2024
2
2
2024
2
2
2024
3
3
2024
1
1
2023
I am looking to get the unique count of IDs when the month num is equal ...
1
vote
1
answer
87
views
PostgreSQL: count unique values from multiple columns
Lets have a table with two columns [col1, col2] with some values. values in col1 and col2 can be repeated. I would like to get number of unique values from both columns.
select
count(distinct col1) ...
0
votes
1
answer
37
views
XQUERY Counting & Unique Values
Working in BaseX, I'm trying to list the number of publishers in an xml database that contains a bookstore and how many books there are for each publisher. So I have the below xquery:
let $publisher:= ...
0
votes
0
answers
33
views
How to make the same object with the same script, but have it output different values each object
Whenever I created 2 objects with the same script, when I update one object they both update
I’ve been working on a model solar system which has a couple of planet game objects that include simplex ...
4
votes
2
answers
106
views
Dapper - Lists of nested objects getting repeated values
I require to have a single API Endpoint, which will fetch records from these four tables in a single JSON file. I am using an ASP.NET Core 8 Web API. Inside QueryAsync, I tried different combinations, ...
0
votes
2
answers
79
views
devide values with JSONata
JSONata is honestly driving me crazy. I asked something similar a couple of weeks ago, but I still don't know what I'm doing so here I am again.
What I'm working with:
[[ {
"time": &...
-1
votes
2
answers
452
views
How to find the unique fields in elasticsearch/opensearch and order by its value(some other field)? (Find set of Distinct values in elasticsearch)
I have an index in my elasticsearch with multiple fields, out of which I want to fetch 2 fields combination (id , name). How to write the query such that i want to order the result(based on whole ...
0
votes
1
answer
435
views
BigQuery: Array index 1 is out of bounds (overflow) [Finding distinct counts for ALL columns without specifying column names)
On Bigquery, I have a table with many columns. I want to create a new table showing counts of all distinct values for all columns.
I am using the below code:
SELECT key AS column_name,
COUNT(DISTINCT ...
-1
votes
1
answer
68
views
LAG with multiple repeating columns [duplicate]
I have a table with multiple encounters. Each encounter can have multiple encounter groups, and there can be 1 or more activities within the encounter group.
encounter_id
encounter_group_id
activity
...
0
votes
1
answer
248
views
Increment (and Decrement) values in a [Google Sheet] column
The image (attached) is a simple "AppScript" adapted from a popular YouTube ...that allows "Values" (in a column) to be increased by 1 - by clicking an "Arrow" (button) - ...
0
votes
0
answers
18
views
Why do I not get the same result when I run a TAIL command from console of a remote server as when I run the same command from a script on local svr? [duplicate]
I connect to my remote server via ssh from the console
[mylocalserver]$ ssh -p 27 myremoteserver
On my remote server, I have a log file (mylogfile.log) that contains several lines
File mylogfile.log ...
0
votes
0
answers
58
views
Inserting data into tables
I'm writing a query to insert data from two sources. In these sources, sale_id is unique, but when inserting data, I'm experiencing infinite duplication in the SALE_SRC_ID. The value 2000000000 should ...
0
votes
2
answers
56
views
Get pairs of distinct values from two many to many columns
Two columns from the same table with many to many relation. In other words, ID 1 can possibly match with matchID A or B. Meanwhile matchID A can possibly match with ID 1, 2 or 3.
ID
matchID
1
A
1
B
...
1
vote
1
answer
51
views
How to filter a pandas dataframe by unique column values
I have a pandas data frame with emails and I want to extract only the unique emails per row.
I tried the code below but it does not work. It returns no change to the original data frame.
Here is the ...
0
votes
1
answer
48
views
Distinct date count of records in RealmSwift?
I have records with date field:
class SomeRealmObject: Object {
@Persisted(primaryKey: true) var _id: ObjectId
@Persisted var date: Date
... //some other properties
}
The goal is to ...
-1
votes
2
answers
724
views
LeetCode Question - 2634. Filter Elements from Array
When I try to run this code without the Number(), it doesn't work.
ar filter = (arr, fn) => {
let filteredArr = [];
for(const i in arr){
if(fn(arr[i], Number(i))) filteredArr.push(arr[...
0
votes
1
answer
22
views
Python time optimization for finding distinct sets of elements
I've got a python HW that looks like this:
find the number of clothes sets that each clothing has a different color.
The input = n (number of costumes)
For the next n line the input will be number of ...
1
vote
1
answer
188
views
Can I merge sketches present in 2 different columns in Google BigQuery
If i have 2 columns with sketches made on the same datatype, can i merge the sketches in both columns to get a final sketch corresponding to each row in the dataset in Google BigQuery?
col1 | col2 | ...
-1
votes
1
answer
20
views
Filtering table by distinct values and multiple rows
Lets say I have a table like this called my_table:
f_id name status date
1 12 walnut passed 7/17/2023
2 13 beech passed 7/18/2023
3 12 walnut failed 7/19/2023
4 ...
0
votes
2
answers
399
views
Power BI / DAX - COUNT Frequency of Unique strings/values across multiple columns
I have a table with 3 columns like this:
Table1
In PowerBI I would like to count the frequency of each unique value/string and get it in a seperate table like this:
Table2
I'm finding all different ...
0
votes
1
answer
1k
views
Distinct count in pivot adds 'empty' to pivot
I was happy to find out there is an option for a distinct count in pivottables.
I used it, but found out something happened which I cannot explain:
When I use the normal count command, I get a nice, ...
0
votes
2
answers
41
views
Get value from an array and check for individual values
I have 3 dropdowns selects (each drop-down has values from 0 to 25):
<select class="form-select" id="select1" name="select1">
<option selected value="0"...
1
vote
0
answers
39
views
How to get distinct values in an array and group by them in MongoDB
I have data as below, and I want to get the distinct values from array and count their occurance.
Data :
[
{
"key": "Dummy",
"country_array": [
"USA&...
0
votes
1
answer
33
views
How can I retrieve the oldest record from a joined table in SQL with distinct values for a specific column and a certain condition?
I want to get distinct vale for column "ID" with condition "Status"=1 and pick the oldest "Date".
There are 2 tables:Table1
| ID | Code | Date |
|--------- |...
0
votes
1
answer
69
views
Reorder data from multiplexed column values to rows
I have a table organization as below where temperature measurements are all stored in one column and there are 14 different temperature samples at different depths per timestamp.
select * from ...
0
votes
1
answer
57
views
Create view which contains multiple list columns
I have searched high and low but can't seem to find an answer.
I want to create a status table which contains multiple lists from 3 different tables.
for example,
table 1 distinct of customer_status ...
0
votes
3
answers
196
views
Counting Unique Numbers in Excel
Expected Results I am trying to count how many unique numbers are in a column.
I tried IF(A2=A3,"1","0"), but it doesn't work because there are multiple invoices in some cases.
...
0
votes
1
answer
505
views
I need to SQL query a rolling 90-day distinct count of ids in a table, only counting ids that appear 3 or more times (at least 3 interactions)
I have an 'interactions' table that basically has a row for each time an id interacted. So there can be many repeated ids:
id
dateinteracted
1651
September 15, 2017, 3:07 PM
1366
June 28, 2017, 8:...
-1
votes
1
answer
65
views
Whenever I try to execute the program it says" Pizza does not refer to an value" Can somebody explain why
Whenever I try to execute the program it says" Pizza does not refer to an value" Can somebody explain why.
Please note that I am using Xcode on Mac OS X Monterey
I am following Rob Percials ...
1
vote
2
answers
57
views
How to count distinct values for multiple columns in R for a grouped data frame
I have a data frame like this:
v_1 <- c("1a", "1b","1c", "2a", "2b", "2c", "3a", "3b","3c", "4a", ...
0
votes
1
answer
390
views
How to flatten array of objects in jq
I have an array of objects in a json file:
{
"Items": [
{
"LOCATION": {
"NAME": "Dallas"
}
},
{
"LOCATION": {
...
2
votes
4
answers
517
views
Excel: Count distinct numerical values if string condition matches
I have a list of employee names on one tab and another tab with orders shipped by employees and the month they were shipped going back 12 months. I'd like to calculate the average number of products ...
-1
votes
2
answers
109
views
How to filter with the same value but different amount [duplicate]
I have the same data on Account, Item, Project, Location, Date, and Version only differs in the Amount
Account
Item
Project
Location
Date
Version
Amount
Acc1
1001
B1
CA
11/27/2022
Actual
100
Acc1
...
0
votes
3
answers
73
views
How can I adjust my code to identify if all values of an array are distinct given the test inputs?
I am unsure as to why my code does not give the correct outputs for the test data which has been provided to me.
Write a procedure 'allDistinct' that takes an array of objects and returns true iff ...
-1
votes
1
answer
36
views
How to find unique rows from table sqlite android?
How can i get the unique rows from a table in sqlite database android
1
vote
1
answer
158
views
ruby - transform_value of a specific key[1]
I am trying for each row to compare the fx value of each corresponding name;
So the outcome should be : diff={"name"=>"XPT", "fx"=>"1.1315313597682419"}
...
-1
votes
2
answers
510
views
druid sql query - count distinctly for a multi value field across records
Is there a way to do a distinct count across different rows for a multi-value field in druid SQL for a particular value in which value is only counted once across an array? eg suppose I have below ...
0
votes
0
answers
333
views
Mongodb - java - retrieve distinct values of multiple fields
I have a collection with repeated values for columns in the documents. I want to query for distinct values of multiple fields(System, subsystem) combination. Below is a sample data:
"System"...
2
votes
2
answers
79
views
counter for unique values found along the vector
first of all let me say that I have searched a lot for this basic question, but none of the answers found seems to do the job. If this specific question has already an answer, please excuse me.
I want ...
0
votes
1
answer
35
views
How to get distinct list of names from a consultation list, and show only latest consultation in Django?
What I want to accomplish is to get a unique list of the names of customers with their lastest consultation date.
I have defined these models in my models.py file, using mySQL as my database:
class ...
1
vote
2
answers
2k
views
Create multiple excel files keeping only specific values in column A from a master sheet
I am really struggling in creating a macro that from a master Excel file creates multiple Excel files based on the values in the first column. More specifically, I have in column "A" some ...
0
votes
2
answers
54
views
SQL how to count unique values that meet specific criteria, and exclude them from the count if their repeating duplicates don't meet my criteria
I have a table with user_id's and number of impressions they received during a certain period of time. A new record is added to the table when there is a new impression. Ex below:
user_id
impressions
...
0
votes
2
answers
3k
views
Excel: How to count number of distinct values that meet multiple conditions - single cell?
Client Number
Matter Number
Address
Physical Files
Electronic Files
If any?
10001
1000101
Addy1
No
No
0
10001
1000102
||
No
No
0
10002
1000201
NULL
1
10003
1000301
Addy3
Yes
Yes
1
10004
...
1
vote
1
answer
392
views
Get Unique Values from a list of Objects
Public Class Related Practice{ String Name; Integer id; }
Given a list of 'Related Practice' Objects, I want to extract unique 'Name' values(Distinct values) from the List .
I made an attempt, but it ...