Streams are a key model component. They represent a structured store of data within PhixFlow receiving data from one or more components, processing it then storing it.
Stream Properties
For information about the properties toolbar, and about the sections Parent Details, Analysis Models, Description and Audit Summary, see Common Properties. We recommend you always add a Description that explains the purpose of the item you are creating.
For a full list of all the PhixFlow property tabs and windows, see Properties, Windows, Menus and Toolbars.
The tab toolbar has the following additional buttons:
Basic Settings
Field | Description |
---|---|
Name | The name of the stream. |
Enabled | Error rendering macro 'excerpt-include' : No link could be created for '_check_box_ticked'. to include the steam during analysis runs. |
Static Data | Error rendering macro 'excerpt-include' : No link could be created for '_check_box_ticked'. to set the stream to hold static data. Static data is reference or "look up" data that is used as part of a stream calculation.Updating a static streamStatic streams are not updated during an analysis run that is initiated on another stream in the model. Instead, to update the data in a static stream you must run analysis directly on the stream
|
Period | Select the time period for the stream. This can be either a regular period, or variable.
As transactional streams need a |
Stream Type | Select the stream type. The type indicates the function that operates on the data.
|
Supersede Items on Pipe | Select a loop pipe from the list of those available. A loop pipe links the stream back to itself. It compares new data records to the existing data records. If there is a repeated record PhixFlow uses the new one in the stream and marks the old one as |
Audit Manual Changes | This check box is available when the Period is Transactional. Error rendering macro 'excerpt-include' : No link could be created for '_check_box_ticked'. to update and delete initiated by stream actions (not those carried out by analysis runs) will automatically mark the existing record as superceded and create a new stream set. The new versions of the updated records will be placed in the new stream set. Inserts will simply create a new stream set, and add the inserted record into that stream set.When Audit Manual Changes is first set, the attributes
|
Attributes
The grid contains a list of list of the stream attributes in the stream. This section has a toolbar with standard buttons and
To add an attribute to the list:
- Click Error rendering macro 'excerpt-include' : No link could be created for '_stream_show'.to list the streams available in the repository.
- Expand a stream to show its attributes.
- Drag an attribute into this list to add it.
To remove an attribute from the stream, use in the toolbar. Delete
To edit the properties of an attribute, double-click the attribute name to open the <link> properties.
To edit only the expression:
- Right-click an attribute name to display the context menu.
- Select Edit the expression field.
- PhixFlow opens a simple text editor box
- Make changes to the attributes expression.
- Click to save your changes.
Field | Description |
---|---|
Name | Enter the name of the attribute. |
Type | Select the attribute type for the data.
|
Length/ Precision/Significant Figures | This option is available when Type is String, Integer or Decimal. Specify
|
Scale | Only applies to Decimal types. The number of digits after the decimal point; must be less than the number of significant figures. |
Local | Only tick this box if this attribute is only required as part of the stream calculation, and it is not necessary to keep the result. |
Order | The order of the attributes in the stream. This is important because the stream attribute expressions are evaluated in this order. If the results of an attribute expression, or a $ variable calculated during its calculation, are required in the expression of a second attribute - the second attribute must come after the first in the attribute list. |
Expression | The expression used to generate the attribute value. This is written as a PhixFlow Expression. It must evaluate to a single value, of the type specified in the Type field. |
Advanced
Field | Description |
---|---|
Indexed | Tick this option if this field should be indexed in the underlying database. An indexed field should be used to increase performance on very large streams in the following situations:-
|
Filter conditions are case-independent by default | If ticked, new filter conditions on this field are case-insensitive by default. The filter window → Ignore Case check box inherits this setting; see Filters on Data Views. For case-insensitive filters, there is no difference if the attribute is also indexed. This option affects the behaviour of filters for PhixFlow instances running on Oracle or MariaDB (MySQL) databases. For PhixFlow instances running on a SQL Server database, filters are always case-independent. |
Key | For in-memory streams, whether this field will be used as a key value. See How To: Summarise unsorted data with In Memory Streams. |
Cache Key | If a cache key is set, the value of this attribute persists throughout the stream calculation, rather than being created from scratch for each stream item as normal. This allows you to keep track of the calculation as it progresses. The cache key is an expression that is evaluated for each stream item, and of course it can use the existing value of the attribute, in other words, to value it had in the previous stream item processed in the stream calculation. This allows expressions to use the "persistent" attribute value on subsequent stream items. The expression provided in the Cache Key is evaluated for each stream item so that this "persistent" attribute can refer to multiple value keyed on the "Cache Key". |
Description
??
Multipliers and Filters
Field | Description |
---|---|
Input Multiplier | The input multiplier expression should evaluate to a list of one or more values. For each value in the list, the internal variable _inputMultiplier will be set to that value and the whole stream processing will be repeated i.e. the pull pipes will be read and the data from those pipes processed to generate output stream items to be added to the current stream set. For example : do ( $aRange = [], addElement($aRange, rng.RangeFrom), addElement($aRange, rng.RangeTo), $bRange = [], addElement($bRange, $aRange), $bRange ) Where rng.RangeFrom = 500 and rng.RangeTo = 1000, the above example evaluates to [[500,1000]], which is a list containing 1 element, which is itself a list containing 2 elements. An Input Multiplier that evaluates to [3,4,7,8] would run the Stream 4 times.Because Input Multipliers are evaluated first in the PhixFlow Timing Cycle they are often used to look up values that can be passed to Database or other Collectors. |
Output Multiplier | This field is an expression which should evaluate to an array of values. A separate output record will be produced for each value in the array and this value is available as _outputMultiplier in each of the stream output attribute expressions (each value in the array is also available through _type, although this is not recommended usage). In effect this will multiply each of the output records by the number of elements from the returned list. For example : ifNull(in.ASSET, [1,10,12] , // else do [5,7] ) will create 3 records for every record in the stream if in.ASSET contains a value (setting _type = 1, 10 and 12 in each case). Otherwise it will create 2 records for every record in the stream (and set _type = 5 and 7). An Output Multiplier may also evaluate to a record, or a group of records. For example an Output Multiplier with the expression:do( lookup(lkin, $num = in.BNumber), lkin ) will return a list of records which match the lookup on the lkin pipe. In this case the required data can be extracted from the Output Multiplier using the following expression : do ( $values = _type, $values.account_num ) If the output multiplier expression evaluates to _NULL, an empty list of values or an empty list of records then a single output record will be produced with _type set to _NULL, _NULL or an empty record respectively. |
Output Filter | This field is an expression which should evaluate to true or false (equivalently 1 or 0). Records created as output from the stream function can be filtered before they are written to the stream. Any attribute of the output record can be used in the expression. If an output filter expression is provided then the output record will only be written to the database if the expression evaluates to true or 1. A common pattern for example is to have an attribute on the output record (for example called 'keep') which evaluates to 1 if you wish to keep the record and 0 if you wish to discard it. The output filter expression is then _out.keep. |
Actions
A list of the stream actions on the stream. See Action.
Views
A list of the views on the stream. See Stream View.
Sort Orders
A list of the sort orders on the stream. See Stream View Order.
Filters
A list of the filters on the stream. See Filters on Data Views.
Any filter defined on the stream may appear in the dropdown list of filters accessible from the header of each stream view. To make a filter available in a view, the filter must be added to the list of filters for that view. See Stream View for details.
All filters defined on this tab will be available on the system generated Default View for this Stream.
Inputs
A list of pipes into the stream.
It is possible for this list to include pipes that have no input. This occurs if the source stream has been deleted, or if a model has been moved to a different PhixFlow instance (export/import), leaving behind a referenced stream. Any pipes with no input are highlighted in yellow. To resolve pipes with no input you can:
- recreate the missing stream
- import the missing stream
- keep the connection, if it will be restored when the model is moved to a different PhixFlow instance
- delete the pipe, if it is no longer required.
Archive Settings
Field | Description |
---|---|
Keep for X Days | The number of days data to keep in the stream. When an archive task runs for a stream, all stream data is deleted if it is at least Keep for X Days old or if it is older than the Keep for Y Stream Sets most recent valid stream sets. If both Keep for X Days and Keep for Y Stream Sets are set, stream data will be deleted only if it meets both conditions. If neither are set, stream data is kept indefinitely. If Save Archive to File is ticked, deleted items are first saved to archive files. The age of data in a stream set is its 'to' date relative to the 'to' date of the newest valid stream set in the stream. See here for how to set up and schedule an Archive Task. Please see the section below on Archiving Examples to see how this value can be used within Archiving strategies. |
Keep for Y StreamSets | The number of stream sets data to keep in the stream. See Keep for X Days for the main description of archiving. |
Keep Superseded for X Days | The number of days for which to keep superseded data in the stream. If Track Superseded Data is ticked, then this field will become visible/enabled. In a stream where the superseded date is tracked, the stream data will contain a mixture of superseded records and "active" records - that is, records that have not been superseded. When an archive task runs for a stream, records that were marked as superseded more than Keep Superseded for X Days days or more than Keep Superseded for Y Stream Sets stream sets ago are deleted. If both Keep Superseded for X Days and Keep Superseded for Y Stream Sets are set, superseded records will be deleted only if they meet both conditions. If neither are set, superseded records are not deleted. This means, for example, that if you have set Keep Superseded for X Days to 4, you will be able to roll back 3 days, making the 4th day the latest valid day. If Save Archive to File is ticked, deleted items are first saved to archive files. Please see the section below on Archiving Superceded Examples to see how this value can be used within Archiving strategies. |
Keep Superseded for Y StreamSets | The number of stream sets for which to keep superseded data in the stream. If Track Superseded Data is ticked, then this field will become visible/enabled. See Keep Superseded for X Days for the main description of archiving superseded records. |
Save Archive to File | If Save Archive to File is set, archived data will be written to compressed archive files before being deleted. |
Apply Archive Filter | If this flag is ticked then a dialog box appears within which a filter can be created. This filter will be applied during archiving and only the records which match the filter will be archived and deleted. |
Access Permissions
Field | Description |
---|---|
All Users Can View Data | If checked, this specifies that all users can view this data by default (provided they have the basic privilege to view streams). If this field is not checked, then access to the underlying data is controlled by dropping user groups onto the stream's "User Group" tab. Note that the default setting for this field on streams is controlled by the system parameter allowAccessToDataByDefault. |
Analysis Models
A list of the analysis models that this stream appears on.
Advanced
The advanced properties field should only be set by, or under the guidance of, PhixFlow support.
Field | Description |
---|---|
Index Scheme | This determines how indexes on the Stream are organised. There are two possible settings:
|
Storage Type | Specifies how data for the Stream should be stored:
|
Start Date | The date that this stream starts. Data will be populated into the stream from this date onwards. |
In Memory Cache Size | The size of the cache that will be maintained when you are using an in-memory stream. See How To: Summarise unsorted data with In Memory Streams. |
Allow Partial Set Processing | If ticked, when analysis reaches the end of a buffer block it submits the candidate set for processing, even if the next buffer block has a different key. |
Prevent Parallel Processing | This field only appears if the Period is set to Transactional. If ticked, it ensures that only a single stream set can be generated at a time even if the stream receives several concurrent requests to generate data. This can be useful where you want to make sure that two analysis runs don't attempt to update the same records at the same time e.g. as a result of two people selecting the same records in a view and then hitting the same action button at the same time to process those records. |
Run Alone | If this flag is ticked then whenever the analysis engine needs to generate data for this stream it will first wait for all running tasks to complete before it starts. Any additional analysis tasks submitted while this stream is waiting to start, or while it is generating data, will wait until this stream has completed its analysis before they start. |
Key Tolerances | When building a candidate set, data can be grouped together using a specific key value, e.g. Account Number. If the key value is a number, setting a key tolerance will identify numbers within the given tolerance as the the same key value. |
Write in Single Transaction | If this is ticked, all of the records for a Stream Set will be written to the database in a single transaction. |
Maximum Records to Write | The maximum number of records per Stream Set if Write in Single Transaction is ticked. |
Default View | The default view selected for the stream. See help on Views for details of creating views on streams. |
Last Run Date (Read only) | The date and time that analysis was last run for this stream. This date is taken from the "to date" of the most recent stream set for this stream. |
Last Run By | The user that last ran this stream. |
Archiving Examples for Full Stream Sets
The table below assumes the stream to be archived currently contains 8 stream sets. Two from the current day and one from each of the previous 6 days.
In the table below the value null refers to the fact that no value has been entered into this field.
Note that archiving will always retain the maximum active stream sets in the data such that no conflicting stream sets will be archived.
Archive After X Days | Keeping Latest Y StreamSets | Resulting Streams Archived/Retained |
---|---|---|
null | null | No stream sets will be archived. |
0 | null | All stream sets will be archived |
1 | null | The last day of valid steam sets will be retained. All earlier stream sets will be archived. In our example the 2 latest stream sets will be retained with the earliest 6 stream sets archived. |
X | null | All stream sets which are older than X days before the latest valid stream set will be archived. |
null | 0 | All stream sets will be archived |
null | 1 | The last valid stream set will be retained, all other stream sets will be archived |
null | Y | The most recent Y valid stream sets will be retained, all others stream sets will be archived. |
0 | 0 | All stream sets will be archived |
0 | 1 | The last valid stream set will be retained, all other stream sets will be archived |
1 | 0 | The last day of valid steam sets will be retained. All earlier stream sets will be archived. |
1 | 1 | The last day of valid steam sets will be retained regardless of if there are more than 1. If there are no stream sets in the last day then the first previous stream set will be retained instead. |
X | Y | Will retain the maximum active stream sets in the data such that no conflicting stream sets will be archived. |
Archiving Examples for Superseded Stream Sets
In the case where only the Keep Superseded for X Days and Keep Superseded for Y StreamSets fields are populated, the same logic in the table above will apply to the superseded records. Note that again archiving will always retain the maximum superseded stream sets in the data such that no conflicting stream sets will be archived.
In the cases where a mixture of the full archive fields Keep for X Days, Keep for Y StreamSets' and the superseded archive fields Keep Superseded for X Days, Keep Superseded for Y StreamSets are populated, then the full archive values will be first applied and the resultant stream item records will be archived and deleted. Only then will the remaining stream sets use the Keep Superseded ... values to apply a further condition to archive and delete any remaining non qualifying superseded records.
Attribute Types
If you load data without specifying a type what happens?
Does PhixFlow make a best guess at what the type is and if it's not sure, assumes string??
What if you want to change a format - e.g set a decimal or date format?
Which fields can have "null"?
String
Apply a string type to sequences of characters (i.e., letters, numerals, symbols and punctuation marks). By default string attribute types have a fixed length of how long?
do we need to tell users about any information-loss if data that is naturally a different type gets loaded as a string?
Bigstring
Apply a bigstring type to text strings over 4000 characters long. Bigstring is a different data type to string and has some restrictions on filtering, sorting and aggregation.
For PhixFlow instances that use an Oracle database, bigstrings cannot be sorted or aggregated. On Oracle bigstrings may only be filtered with the conditions:
(not) contains
is (not) null
(not) starts with
(not) ends with
.
The maximum bigstring size can be configured in System Configuration → System Tuning → Maximum Bigstring Size.
Integer
Apply an integer type to whole numbers (not a fractions or decimals) that can be positive, negative, or zero.
What happens if you attempt to load a float or decimal number into an integer attribute?
Float
Apply a float type to non-integer numbers with an undefined level of precision. Float numbers have:
- significant figures: the total number of digits stored,
- decimal places: the number of digits after the decimal place.
Decimal
Apply a decimal type to non-integer numbers with a set level of precision. Decimals have a specific number of:
- significant figures: the total number of digits stored,
- decimal places: the number of digits after the decimal place.
The maximum number of integer digits is therefore the significant figure minus the decimal places. By default, decimals have 10 significant figures and 2 decimal places, and therefore 8 integer digits.
If the number of integer digits present in a decimal field exceeds the specified format, running analysis will fail and PhixFlow will report an error.
If the number of decimal digits present in a decimal field exceeds the specified format, PhixFlow will discard the excess decimal places. For example, if a data record includes the number 12.3456, but the decimal type can have 4 significant figures and 2 decimal places, PhixFlow records 12.34.
Ensure your decimal type has the number of decimal places you need for yout data. Once the data is loaded into PhixFlow, you will not be able to recover excess decimal places.
Date
Apply a date type to representations of a calendar day.
Are there any specific formats to say are recognised/not recognised?
What about word formats e.g. Tuesday the fourteenth of February?
Datetime
Apply a datetime type to representations of a time, or day and time.
Are there any specific formats to say are recognised/not recognised?
Graphic
Is this still available?
TrueFalse
Apply a TrueFalse type to fields that can have the values true
or false
.
What happens if the field is empty? Or has something other than True/False?