Skip to main content
1-Visitor
September 25, 2019
Question

Purge ALL datatable entries within a time range

  • September 25, 2019
  • 1 reply
  • 4312 views

How do I purge any and all entries for a given datatable that are within a certain time range? I don't care what values may be contained within the time range - I will want to delete them, regardless. 

 

I've tried these two out-of-the-box methods from PTC:

 

Things["MyDataTable"].PurgePropertyHistory({
propertyName: undefined,
endDate: myEndTimeStamp,
immediate: true,
startDate: myStartTimeStamp
});

 

...and......

 

Things["Ford.PFS.GM.Historian.Repository"].PurgeSelectedPropertyHistory({
propertiesToPurge: eventFramesInfoTable
/* I passed an empty infotable here that was the same shape as my data table */,
endDate:myEndTimeStamp,
startDate:myStartTimeStamp
});

 

1 reply

22-Sapphire I
September 26, 2019

I believe that service is not a DataTable service but applies to ValueStreams

You can use: DeleteDataTableEntriesWithQuery

ague1-VisitorAuthor
1-Visitor
September 26, 2019

Those two services that I copied in my question are datatable services - I found them as out-of-the-box services associated with my datatable. 

 

I'll try the query method you suggested and post the results here. 

 

Thank you!

ague1-VisitorAuthor
1-Visitor
September 27, 2019

So then I will assume that this screen shot, attached, is a bug, which PTC will fix. 

(blacked-out content is my datatable name)