0

I have a table in which each row represents a record. The data has a parent-child relation. Updated records are children from a parent record and some parts of the record will be changed. Each record has an insert-date (datetime). I am only interested in the latest records an want to filter the whole dataset for them.

In R I would do it with something like

my_dataset <- my_datset[which(!duplicated(dup.index, fromLast = TRUE)),]

where dup.index is a list of columns which I´ll test for duplicates.

Rüdiger Kladt
  • 119
  • 1
  • 7
  • 1
    (1) You're asking about R-specific concepts, why are [tag:powerbi] and [tag:dax] applicable here? (2) If you're asking solely about a `dup.index`, why is the parent-child relationship necessary, or is it a distractor? (3) Your code generically looks fine, is there a problem with it? There's very little to do to inform/correct that without sample data, expected output, actual text from errors/warnings (if present), etc. Please see https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Jun 07 '22 at 17:51
  • (1) I want to do the same as i did in R with Power BI, DAX. (2) I have data, which represents bookings in a CarSharing-company. Each booking has a unique id and all possible columns. During lifetime the system changes some status information of the booking and adds a child which represents the actual status of the booking with an equal row-structure: booking done, start, end changed, car changed, usestart, useend, price, billed, payed ... Each child has a unique id and a link to the parent id. So we can comprehend the history of every booking. Every day there are thousends different bookings. – Rüdiger Kladt Jun 14 '22 at 06:43

0 Answers0