Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm building my first sheet and running across a problem.
| Product | Order Date | Status | Status Date |
| A | 12/10/2022 | Canceled | 1/5/2023 |
| A | 12/10/2022 | Canceled | 1/5/2023 |
| A | 1/10/2023 | Paid | 1/10/2023 |
Let's say I have a scenario like the above, I'm trying to eliminate duplicates. I only need the most recent order in my dataset.
Filtering by only Paid in my dataset won't work for the project I'm working on.
Any ideas?
Are you looking solution at front-end or at script level?
May be try something like this at script level.
Data:
LOAD
Product,
"Order Date",
Status,
"Status Date"
FROM [lib://data]
(html, utf8, embedded labels, table is @1);
Concatenate(Data)
Load * inline [
Product, Order Date, Status, Status Date
B, 1/10/2023, Paid, 1/30/2023
B, 1/10/2023, Canceled, 1/10/2023
C, 1/12/2023, Canceled, 2/10/2023
C, 1/12/2023, Paid, 2/19/2023
C, 1/14/2023, Canceled, 2/15/2023
];
NoConcatenate
Data_Final:
Load distinct FirstSortedValue(Product,-"Status Date") as Product,
FirstSortedValue("Order Date",-"Status Date") as "Order Date",
FirstSortedValue(Status,-"Status Date") as Status,
FirstSortedValue("Status Date",-"Status Date") as "Status Date"
Resident Data
Group By Product,"Order Date"
Order By Product,"Status Date"
;
Drop table Data
;
This was helpful. Thank you!
Is there a way to do this on the front end?
I need this to work with general data. Inline is great when I want to narrow specific data, but I'm creating a working sheet that'll update daily, so I need the data to concatenate on it's own when these situations arise.
Any ideas on how to alter the load script or do this front end?