complex Datapoints- To Capture Historical Data
Hi
Can you please guide me, how to pull the historical data to create Complex data point using Groovy Script.
For Examples: I have a Datapoint X. I want to create a complex data point, which capture the MAX(X) from last 24 Hours. Please Guide me how to proceed.
manthena2020
Posted 2 years ago·Last reply 2 years ago
2 comments
LM User
·2 years agomanthena2020
OP2 years agoGroovy Script For Complex DataPoint
import com.santaba.agent.groovyapi.api.DataCollectionAPI
def dataPointName = "Running"
def day = System.currentTimeMillis() - 1 * 24 * 60 * 60 * 1000
def historicalData = DataCollectionAPI.getHistoricalData(dataPointName,day, System.currentTimeMillis())
def maxRunningWithinWeek = historicalData.max()
return maxRunningWithinWeek