To work with the tool in Foresight Analytics Platform 10, use the new interface.
Data sources determine the objects, based on which a calculation block will be executed.
Data sources can be selected and set up on the Sources page in the calculation block editing wizard:
To select and set up a data source:
Click the Add button. The object selection dialog box opens, in which specify the data source.
The following repository objects can be used as data sources:
Select calendar role. By default, a calendar is considered as a calendar dimension and it cannot be used to set up links. To work with calendar as a standard dimension, select the calendar checkbox located next to the data source name. Calendar will be displayed in the list of source dimensions and it can be used as a standard dimension. To use calendar as a calendar dimension, deselect the Calendar checkbox.
Set up links between data source and data consumer dimensions. The links set correspondence between data source dimensions and data consumer dimensions therefore reduce the number of calculated elements and speed up block calculation. To set up links, click the Set Up button. Set links in the Set Up Links dialog box that opens. To automatically set up links by attribute identifiers in the same source and consumer dimensions, click the Link All button.
As a result, the data source is added and set up. If required, similarly add other data sources.
To delete the data source, click the Delete button. If the data source is used in calculation formulas, the confirmation dialog box opens on data source deletion:
Select the operation:
OK. The data source will be deleted. The terms in use with the deleted data source in calculation formulas will be replaced with Null.
Cancel. The data source will not be deleted.
Open Formula Editor. The formula editor opens to change calculation formulas with the deleted data source. The formula editor dialog box enables the user only to edit and delete the formulas that use the data source. After changing or deleting the formula, click the OK button and confirm the action in the Delete Block Source dialog box.
The links set correspondence between data source dimensions and data consumer dimensions therefore reduce the number of calculated elements and speed up block calculation.
To set up links between data source and data consumer dimensions, use the Set Up Links dialog box. A link can be set up in various modes: simple and advanced. The dialog box appearance differs depending on the setup mode:
Setup order:
Simple mode. It is used by default.
Select data sources, for which links will be set up. To do this, use the drop-down list at the top left corner of the dialog box. The Source Dimension column contains all dimensions of the selected data sources. By default, the data source is selected in the list, which is selected on the Sources page in the calculation block editing wizard. If no data source is selected on the page, all block data sources are selected in the list.
Select linked attribute in data source dimension in the Source Attribute column.
In the Consumer Dimension and Attribute column select the attribute from the data source dimension containing the same values as the those in the selected data source attribute. The list contains only consumer dimensions, for which filtering is set up. For example, the Index attribute is selected in the Cities dimension to create a link. To create a correct link, in the data consumer select the attribute containing city index in the dimension with cities data.
NOTE. if the calculation block is editable and no links are created for the data source dimension, and this data source is already used in block calculation formulas, a warning is displayed on creating a link that this dimension will be deselected in formula operands. Thus, formulas are calculated by one dimension. To continue creating a link and deselect the dimension in the formula, click the Yes button; to abort creating a link, click the No button.
Advanced mode. It enables the user to set up link behavior and selection offset in data consumer. To get example of link functioning with different behavior and different offset, see the Examples of Functioning of Link between Data Source and Data Consumer Dimensions section.
Execute all setup steps described in the simple mode.
Click the Advanced Mode button. The dialog box displays additional columns. To return to the simple mode, click the Simplified Mode button.
Select link work mode in the Behavior column:
Default. The linked data source dimension will contain only those selected elements, which have corresponding selected element in the linked data consumer dimension. If the corresponding element is not found in the data source, a calculation error is displayed.
Filter Consumer. The linked data consumer dimension will have only those selected elements, which have corresponding selected element in the linked data source dimension.
Empty Point if Element is not Found. The linked data source dimension will contain only those selected elements, which have corresponding selected element in the linked data consumer dimension. If the corresponding element has not been found in the data source, the Null value is used instead of it in calculation.
Set the number of elements, by which selection in the data source dimension is offset, in the Offset group in the Lag column. Specify offset mode in the Type column:
Current Element. It is used by default. Selection is offset for each selected element obtained by the link.
First Element. Selection is offset only for the first selected element obtained by the link. Other elements are deselected. If selection by the link is obtained for the elements belonging to different parent elements, the selection is offset only for the first child element in each group of elements belonging to one parent element. Other child elements are deselected. If this offset type is used, the offset can be only positive or zero.
Last Element. Selection is offset only for the last selected element obtained by the link. Other elements are deselected. If the selection belonging to different parent elements is obtained by the link, the selection is offset only for the last child element in each group of elements belonging to one parent element. Other child elements are deselected. If this offset type is used, it can be only negative or zero.
TIP. Use the first element offset or the last element offset to specify that you want to use only one element from multiple elements obtained by the link. For example, multiple child elements are obtained for each element by the link X.KEY = X.PARENT_KEY. To avoid aggregation of these values and simply take value of the penultimate element, select the Last Element value in the Type column and specify the -1 value in the Lag column.
As a result, the link by attributes between dimensions is set. If required, similarly add other attribute links.
To automatically add all possible links based on:
Attribute identifiers, click the Link by Identifiers button. Links are created for all equal dimensions in data sources and data consumers.
Links between dimensions, click the Fill by Dictionary Links button. Links are created for the dimensions that contain linked attributes.
To delete the link between attributes, click the Delete button at the end of the appropriate line.
If a calculation block is edited and the deleted link is the only one for data source dimension, and the data source is already used in block calculation formulas, the Delete Link dialog box opens:
Select a method for fixing selection by this dimension in calculation formula operands:
Default Element. The default element specified using the Fore language in the dictionary, on which dimension is based, is used as a selection. The method is available if default element.
Selected Element. Select the element that will be used as a dimension selection.
Fix Later. The dimension does not have a fixed selection, and calculation is executed by all dimension elements. The selection can be fixed by editing block calculation formulas.
The example displays functioning of the link with different behavior and offset. The dimension in used are abstract and are used to show how links work. The dimensions selection is based on MDM dictionaries that are basis for these dimensions.
For example, there is the Indicators dimension in the data consumer and the Countries dimension in the data source. The dimensions contain the following data and the following selection:
A link is set up between the Key attribute in the Countries dimension and the Country Code attribute in the Indicators dimension:
Consider the selection that will be used in the calculation block on different link behavior:
Default. The linked data source dimension will contain only those selected elements, which have corresponding selected element in the linked data consumer dimension. The calculation returns the error because the selection is not fixed for the Inflation, % element in the Countries dimension.
Filter Consumer. The data consumer linked dimension will keep only the selected elements that have a corresponding selected element in the data source linked dimension.
Empty Point if Element is not Found. The linked data source dimension will contain only those selected elements, which have corresponding selected element in the linked data consumer dimension. When calculation is executed by the Inflation, % element, the Null value will be used in the Countries dimension.
For example, there is the Indicators dimension in the data consumer and the Countries dimension in the data source. The dimensions contain the following data and the following selection:
A link is set up between the Key attribute in the Countries dimension and the Country Code attribute in the Indicators dimension:
Consider the selection that will be used in calculation block if the link uses the offset with different values:
Current Element. Selection is offset for each element obtained by the link.
The selection obtained on applying the offset by one element forward:
First Element. Selection is offset only for the first selected element obtained by the link. Other elements are deselected. If selection by the link is obtained for the elements belonging to different parent elements, the selection is offset only for the first child element in each group of elements belonging to one parent element. Other child elements are deselected.
Selection obtained on applying the offset from the first element by one element forward:
Last Element. Selection is offset only for the last selected element obtained by the link. Other elements are deselected. If the selection belonging to different parent elements is obtained by the link, the selection is offset only for the last child element in each group of elements belonging to one parent element. Other child elements are deselected.
The selection obtained on applying the offset from the last element by one element backward:
See also:
Getting Started with the Calculation Algorithms Extension in the Web Application | Inserting and Setting Up Calculation Blocks