Distinct values with earliest datestamp.
I have a dimension table where new values found in my datasets are added, and a datestamp populated in a column. I have found that I have to do a final sweep in SQL to remove duplicates because of Domo's handling of some invisible characters found in some data feeds.
A select distinct statement works for the majority, but I have a handful of values that keep pushing duplicates. I realized that the statement won't work on rows with the same company name, but different datestamp values.
What do I need to add to SQL for it to identify duplicate values in one column, and keep the row with the earliest datestamp?
@ValientSpur - This is similar to another one you solved, but different enough that I want to make sure you get the solution if you give it to me.
Breaking Down Silos - Building Bridges
**Say "Thanks" by clicking a reaction in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
Comments
-
You could try something like this:
SELECT `CompanyName`, MIN(`Datestamp`) AS 'DateStamp'
FROM dataset
GROUP BY `CompanyName`That would leave you with a single entry for each unique CompanyName and the earliest date value associated with it.
Is that what you're looking for, or am I missing something?
Sincerely,
ValiantSpur
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0
Categories
- All Categories
- 1.4K Product Ideas
- 1.4K Ideas Exchange
- 1.4K Connect
- 1.1K Connectors
- 278 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.7K Transform
- 89 SQL DataFlows
- 557 Datasets
- 2K Magic ETL
- 3.3K Visualize
- 2.3K Charting
- 571 Beast Mode
- 11 App Studio
- 28 Variables
- 579 Automate
- 141 Apps
- 414 APIs & Domo Developer
- 23 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 352 Distribute
- 92 Domo Everywhere
- 258 Scheduled Reports
- 2 Software Integrations
- 92 Manage
- 89 Governance & Security
- 9 Product Release Questions
- Community Forums
- 42 Getting Started
- 28 Community Member Introductions
- 88 Community Announcements
- 4.8K Archive