CB.ExtractDataND

This function extracts Crystal Ball data from the the current simulation. For any preferences not explicitly set, the default is the current setting in the Extract Data dialog. Use CB.CheckData before using this call. You can extract more than one type of data. For details, see CB.ExtractDataND Example 2.

Note:

Before calling this function, run a simulation, OptQuest optimization, or Predictor time-series forecast.

Table 66. CB.ExtractDataND Parameters

Parameter

VBA Data Type

Description

Index

Integer

Specifies which extract preference you are setting. See Table 67, following.

Value (Optional)

Variant

Specifies settings for the preference indicated by the Index. See Table 67 for more information.

Value2 (Optional)

Variant

Specifies whether to extract the specified data type. See CB.ExtractDataND Example 2.

The following are named constant and index values for the Index parameter.

Table 67. CB.ExtractDataND Index Parameter Values (Required, Integer) with Related Value Parameter Values (Optional, Variant)

Index Parameter Named Constant Value

Index Parameter Index Value

Value Parameter Values to Use

Description

cbExtOK

1

n/a

Extracts the data. Use this parameter after setting other extract options.

cbExtDataType

2

See Table 68

Specifies the type of data to extract. Used with these Value parameter values, described in Table 68:

1 = cbDatForeValues (CB 2000.x or 5.x only), 1 = cbDatValues (CB 7.x and 11.x or later), 2 = cbDatStatistics, 3 = cbDatPercentiles, 4 = cbDatFrequencies, 6 = cbDatSensitiv, 7 = cbDatCapMetrics.

cbExtChooseFore

3

See Table 69

Specifies which forecasts to include. Used with these Value parameter values, described in Table 69:

1 = cbChfAll, 2 = cbChfOpen, 3 = cbChfChosen, 4 = cbChfAdd, 5 = cbChfClearList.

cbExtPercentiles

4

See Table 70

Specifies which percentiles to extract. Used with these Value parameter values, described in Table 70:

1 = cbPctQuartiles, 2 = cbPctQuintiles, 3 = cbPctDeciles, 4 = cbPctIcosatiles, 5 = cbPctSet1, 6 = cbPctSet2, 7 = cbPctSet3, 8 = cbPctSet4.

cbExtExistingSheet

5

True or False

True extracts data to a new worksheet called Data in the active workbook. False extracts data to a new worksheet called Data in a new workbook.

cbExtChooseAsm

6

See Table 71

Specifies which assumptions to include. Used with these Value parameter values, described in Table 71:

1 = cbChaAll, 2 = cbChaChosen, 3 = cbChaAdd, 4 = cbChaClearList, 5 = cbChaOpen.

cbExtChartBins

7

A value between 10 and 1000

Indicates how many bins (value groups or intervals) to include.

Note:

This value is independent of the Chart Preferences density setting.

cbExtIncludeCellLoc

8

True or False

True includes cell location information. False does not include cell location information.

cbExtIncludeLabels

9

True or False

True includes labels. False does not include labels.

cbExtAutoFormat

10

True or False

True applies formatting to the cells as appropriate. False does not apply formatting.

cbExtSheetName

11

A string value representing a sheet name

The name of the sheet where extracted data is placed. The sheet name must follow appropriate sheet naming restrictions.

cbExtStartCell

12

A string value representing a starting cell location

Specifies the first (upper-left) cell of the extracted data.

cbExtStartSheet

13

See Table 72

Indicates where to extract the data, described in Table 72:

1 = cbExtNewWorkbook, 2 = cbExtCurrentWorkbook_NewSheet, 3 = cbExtCurrentWorkbook_CurrentSheet.

Note:

Calling ExtractDataND with this value will overwrite any settings through cbExtExistingSheet.

cbExtDataOptimizerType

14

See Table 73

Indicates which OptQuest data to extract following an optimization run. If not explicitly set, the current settings from the Extract Data dialog are used.

cbExtChooseDecVar

15

See Table 74

Indicates which decision variable data to extract following an optimization run. If not explicitly set, the current settings from the Extract Data dialog are used.

cbExtDataPredictorType

16

Constant name or number as described in the next table cell.

Specifies which type of Predictor data to extract:

  • 1 = cbDatPredictorResults, extracts results data

  • 2 = cbDatPredictorMethods, extracts methods data

Note:

The constant is followed by a boolean (True or False) to indicate whether the constant is active or not.

cbExtPredictorResultsSheetName

17

A string value representing a sheet name

The name of the sheet where extracted Predictor results data is placed. The sheet name must follow appropriate sheet naming restrictions.

cbExtPredictorMethodsSheetName

18

A string value representing a sheet name

The name of the sheet where extracted Predictor methods data is placed. The sheet name must follow appropriate sheet naming restrictions.

cbExtPredictorResultsHistorical

19

True or False

True includes historical data in extracted results. False does not include historical data.

cbExtPredictorResultsFitted

20

True or False

True includes fitted data in extracted results. False does not include fitted data.

cbExtPredictorResultsForecast

21

True or False

True includes forecasted data in extracted results. False does not include forecasteddata.

cbExtPredictorResultsConfidence

22

True or False

True includes confidence interval data in extracted results. False does not include confidence interval data.

cbExtPredictorResultsResiduals

23

True or False

True includes residuals data in extracted results. False does not include residuals data. For information on residuals data, see the Oracle Crystal Ball Predictor User's Guide.

cbExtPredictorMethodsErrors

24

True or False

True includes methods error data in extracted results. False does not include methods error data.

cbExtPredictorMethodsStatistics

25

True or False

True includes methods statistics data in extracted results. False does not include methods statistics data.

cbExtPredictorMethodsParameters

26

True or False

True includes methods parameters data in extracted results. False does not include methods parameters data.

cbExtPredictorMethodsRanking

27

True or False

True includes methods ranking data in extracted results. False does not include methods ranking data.

cbExtChartBinsUseEntireRange

28

True or False

True uses the entire chart range, including extreme values that are not displayed. False uses only the displayed chart range.

The following values are used with Index = cbExtDataType to specify the type of Crystal Ball data to extract.

Table 68. Value Parameter Values that Support Index Constant cbExtDataType

Named Constant Value

Index Value

Description

cbDatForeValues

1

Extracts forecast and assumption values

Note:

The constant cbDatForeValues is included for compatibility with Crystal Ball 2000.5 (5.5) and is considered deprecated in later versions of Crystal Ball; for future compatibility, use CBDatValues instead.

cbDatValues

1

Extracts forecast and assumption values; same as cbDatForeValues but name reflects capabilities more accurately

cbDatStatistics

2

Extracts statistics

cbDatPercentiles

3

Extracts percentiles

cbDatFrequencies

4

Extracts the number of data points in each chart bin

cbDatSensitiv

6

Extracts sensitivity data

cbDatCapMetrics

7

Extracts capability metrics data. True extracts the metrics and False does not extract the metrics.

cbPctSet3

7

Extraction of the 5% and 95% percentiles

Note:

The constant cbDatCumulative [5] is not included in this release.

The following values are used with Index = cbExtChooseFore to specify forecast data for extraction.

Table 69. Value Parameter Values that Support Index Constant cbExtChooseFore

Named Constant Value

Index Value

Description

cbChfAll

1

Includes all forecasts

cbChfOpen

2

Includes open forecasts

cbChfChosen

3

Includes chosen forecasts. Use after cbChfAdd.

cbChfAdd

4

Adds the forecast in the selected cell to the list of chosen forecasts. Use cbChfChosen after this option.

Note:

An error is returned if the user attempts to add (cbChfAdd) a forecast which contains no underlying data. During extraction, only those forecasts with underlying data are actually extracted. The others are ignored.

cbChfClearList

5

Clears the list of chosen forecasts

The following values are used with Index = cbExtPercentiles to specify percentile data for extraction.

Table 70. Value Parameter Values that Support Index Constant cbExtPercentiles

Named Constant Value

Index Value

Description

cbPctQuartiles

1

Extracts quartiles (25%)

cbPctQuintiles

2

Extracts quintiles (20%)

cbPctDeciles

3

Extracts deciles (10%)

cbPctIcosatiles

4

Extracts icosatiles (5%)

cbPctSet1

5

Extracts 2.5, 5, 50, 95, 97.5%-iles

cbPctSet2

6

Extracts 10, 25, 50, 75, 90%-iles

cbPctSet3

7

Extracts the 5% and 95% percentiles

cbPctSet4

8

Extracts the 10% and 90% percentiles

The following values are used with Index = cbExtChooseAsm to specify assumption data for extraction.

Table 71. Value Parameter Values that Support Index Constant cbExtChooseAsm

Named Constant Value

Index Value

Description

cbChaAll

1

Includes all assumptions

cbChaChosen

2

Includes chosen assumptions. Run this option after adding assumptions.

cbChaAdd

3

Adds the assumption in the selected cell to the chosen assumptions. Use cbChaChosen after this option.

cbChaClearList

4

Clears the list of chosen assumptions

cbChaOpen

5

Includes all open assumptions

The following values are used with Index = cbExtStartSheet to specify whether data should be extracted to a new or existing workbook and worksheet.

Note:

Calling ExtractDataND with cbExtStartSheet will overwrite any settings made with cbExtExistingSheet.

Table 72. Value Parameter Values that Support Index Constant cbExtStartSheet

Named Constant Value

Index Value

Description

cbExtNewWorkbook

1

Extracts the results to a new workbook, using the cbExtSheetName value as the name of the sheet

cbExtCurrentWorkbook_NewSheet

2

Extracts the results to the current workbook using the cbExtSheetName value as the name of the sheet

cbExtCurrentWorkbook_CurrentSheet

3

Extracts the results to the current workbook’s current sheet

The following values are used with Index = cbExtDataOptimizerType to specify which optimizer data should be extracted to the specified location. A third boolean value, True or False, is used to activate or deactivate the preceding entries.

Table 73. Value Parameter Values for Index Constant cbExtDataOptimizerType

Named Constant Value

Index Value

Description

cbDatOptimizerSolutions

1

Extracts OptQuest solution information

cbDatOptimizerStatistics

2

Extracts OptQuest statistical information

The following values are used with Index = cbExtChooseDecVar to specify decision variable data for extraction. If not specified, the current setting from the Extract Data dialog is used.

Table 74. Value Parameter Values that Support Index Constant cbExtChooseDecVar

Named Constant Value

Index Value

Description

cbChooseDecVarAll

1

Includes all decision variables

cbChooseDecVarChosen

2

Includes chosen forecasts. Use after cbChooseDecVarAdd.

cbChooseDecVarAdd

3

Adds the forecast in the selected cell to the list of chosen forecasts. Use cbChooseDecVarChosen after this option.

cbChooseDecVarClearList

4

Clears the list of chosen forecasts

Run a simulation before you call CB.ExtractDataND. Extraction of data from restored results is not supported.

See the Oracle Crystal Ball User's Guide for more information on extracting data.