651 questions
5 votes
6 answers
194 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 ...
1 vote
3 answers
92 views
How to remove duplicates before Bind (how to run Distinct on IChangeSet<T>)?
Here is repro (very simplified real case). If I have SourceList<Foo>, each containing SourceList<Bar>, then I can flatten bars from all foos into a single collection using following code, ...
0 votes
1 answer
290 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
2 answers
131 views
Return Distinct Concat Count if More Than One Result
I'm trying to get a distinct count of multiple columns grouped by another column, but I want the results to only include counts greater than ONE. So if I have the following: SELECT * FROM cast ORDER ...
1 vote
1 answer
98 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
2 answers
81 views
Find rows without duplicates in columns
I have a large table [MasterTable] with 31 columns. For each [TrackID], there are 5 rows, all identical except two columns, [ResultFK] and [ParamFK], linked to two other tables. My end goal is to ...
-1 votes
3 answers
161 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
81 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
52 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
128 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="\"'()" # ...
-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 ...
0 votes
2 answers
106 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 or lower ...
1 vote
1 answer
324 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
55 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
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 ...