651 questions
5
votes
6
answers
173
views
DistinctBy, but preserve the last element of each group of duplicates
I have a list of items that contains duplicates, and I want to keep the last item of each group of duplicates. The native DistinctBy LINQ operator keeps the first item from each group, so it doesn't ...
0
votes
1
answer
287
views
Excel Distinct Counts on Pivot Tables are aggregating incorrectly
I have the followng table in Excel and I am trying to aggregate the distinct counts, in a pivot table, however the values are off and I am wondering why. I am using the distinct count option within ...
1
vote
1
answer
91
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’...
-1
votes
3
answers
148
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
49
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
votes
2
answers
128
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 ...
1
vote
1
answer
323
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
0
answers
71
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 ...
0
votes
2
answers
107
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": &...
0
votes
1
answer
2k
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 ...
0
votes
1
answer
602
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
60
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 ...
1
vote
1
answer
60
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
3
answers
979
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[...
1
vote
1
answer
269
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 | ...
0
votes
2
answers
541
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
2
answers
43
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"...
0
votes
1
answer
44
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
70
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
1
answer
694
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:32 ...
1
vote
2
answers
70
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", ...
2
votes
4
answers
942
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 ...
0
votes
3
answers
188
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 ...
0
votes
1
answer
208
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"}
...
0
votes
0
answers
429
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"...