Skip to main content
8-Gravel
January 4, 2021
Solved

Cannot Purge Value Stream / Thing logged data

  • January 4, 2021
  • 1 reply
  • 7763 views

Hello,

 

I have some problems understanding / using the "PurgeAllPropertyHistory" of the Thing of which Iam trying to delete the logged data from.

 

The logged data are full numbers (1,2,3...)

 

What exactly is the startDate and the endDate? Does the "PurgeAllPropertyHistory" even care about which Date is being set here (It just has to be different I assume)?

 

Is it possible to delete ALL logged data without setting startDate and endDate?

 

I am trying to purge the data via a Mashup with a button that is connected to the "PurgeAllPropertyHistory" of my thing. I also tried to add startDate and endDate values per datePicker and the set it via Button

Best answer by slangley

Hi @NHorst.

 

It appears your issue was resolved via the case that was opened.  Answers to some of your questions are as follows:

  • PurgeAllPropertyHistory is used to purge all values of all the logged properties on a thing between the given dates.
  • The service expects a start and an end date
    • If no start date is specified, the service will execute from 1970
    • If no end date is provide, the service takes the run time  TimeStamp as end time and deletes all properties from start date to the run time
  •  If you are using a Mashup to pass the parameters to a service, we recommend making the parameters to the service as “Required” so that no data is accidentally removed.

Please let us know if this can be considered the solution to your case or if additional information needs to be posted here for the benefit of others in the community.

 

Regards.

 

--Sharon

1 reply

5-Regular Member
January 4, 2021

Hello @NHorst ,

 

Value Stream is dependent on its Thing.

Running a purge on a Thing, will only clear out that Thing.

 

There are 3 different purges available on the Thing - PurgeAllPropertyHistory, PurgePropertyHistory and PurgeSelectedPropertyHistory.

  • PurgeAllPropertyHistory - purges all logged properties on the Thing
  • PurgePropertyHistory - purges a property that is logged (you need to give the name of the property that is logged)
  • PurgeSelectedPropertyHistory - purges a list of properties on the Thing (takes an Infotable input of the properties you want to purge)

 

With that being said, you need to give a start and end date or it won't purge/ delete your data.

When you call service PurgeAllPropertyHistory to remove all the data entries from a Thing using the Value Stream, make sure you also select the startDate and endDate, and also make sure the startDate is on the bottom and endDate is on the top.

 

Hope it helps,

 

NHorst8-GravelAuthor
8-Gravel
January 4, 2021

Hello @Ciprian-Traian ,

 

Thank you for your reply.

 

I already tried every combination of start and end Dates that I can think of.. do I have to clear the Thing or the ValueStream? I think I tried clearing both but It seems like the data is still available (I am using a graph to see if its still there or not)

 

Would startDate be the date that is today and endDate is the date that I want to delete to or is it reversed?

 

Is there a way I can manually delete / see the data? Where exactly is it saved in the msql database?

15-Moonstone
January 5, 2021

Hi @NHorst ,

Mention endDate as current time( var currentDate = new Date() ); Keep the start date as it is (undefined) .