PP.TS.isPredictionSerie

Syntax

isPredictionSerie (serie);

Parameters

serie. Sets series.

Description

The isPredictionSerie method determines whether specified series is calculated using a Forecasting formula.

Comments

This method returns True if formula type of the series passed to the method as a parameter, is Forecasting, otherwise the method returns False.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and the following code must be added in the document opening event handler:

var getIsPredictionSerieButt = new PP.Ui.Button({
	ParentNode: document.body, //DOM parent node
	Content: "Get Series Type", //Text/r
	Click: PP.Delegate(onClickType)     
}); 
function onClickType()
	{
		var series = wbk.getSeries();
		var messageString = "";
		for (var i = 0; i<series.length; i++)
			{
				//Determine whether the specified series is calculated by the Forecasting formula
				PP.TS.isPredictionSerie(series[i]) ? addPredictionSerieString(i) : addNonPredictionSerieString(i);
			}
		function addPredictionSerieString(rowIndex)
			{
				messageString = messageString + "The series number " + i + " - has the Forecasting formula type" + '\n';
			}
		function addNonPredictionSerieString(rowIndex)
			{
				messageString = messageString + "The series number " + i + " -  has a formula type that differs from the Forecasting type" + '\n';
			}	
		alert(messageString);
	}

After executing the example the Get Series Type button is placed in the HTML page. Clicking this button shows a message if the series available in the table are calculated using a Forecasting formula.

See also:

PP.TS