One purpose of dataflow is to work with tables. Tables are used by charts, data grids, repeaters, and other DGLux5 components and widgets. This page covers:
Dataflow does not support duplicate column names within a table. In particular, the Column Mapping block and the Filter block do not support duplicate column names.
To load a table, first open the dataflow model or the Project Dataflow. Then, follow the relevant procedure below.
If you want to use this table as the source for a component, you might want to insert the component first. Then, you can insert the table in the component's dataflow model.
To load a table from a metric history:
Without closing the dataflow window, open the Data panel, and select the relevant node.
In the Metrics panel, find the relevant data metric, and drag its History icon to the dataflow window.
To open the table, select the Load History dataflow block, and in the block properties panel, click the value of the output property.
To load one table from multiple data metric histories:
In the dataflow window, expand Data Services, and drag a Multi-Histories block to the dataflow.
In the Data panel, select the relevant data source.
In the Metrics panel, select a relevant data metric, and drag its History icon to the pop-up.
Before loading a table from a CSV or JSON file, you might want to upload the file to your project.
To load a CSV or JSON string and then parse it into a table:
In the block palette, expand Data Services, and drag a String Loader block onto the dataflow window.
In the Project panel, find the JSON or CSV file in your DGLux5 project, drag it to the path property of the String Loader block, and press Enter or Return.
You can also enter an absolute URL as the path property.
The CSV or JSON string appears as the output property.
Expand Table Operations, and drag a CSV Parser or JSON Parser block onto the dataflow window.
Bind the output property of the String Loader block to the input property of the CSV Parser or JSON Parser block.
You can also load JSON data from a web source using the JSONP Loader block.
To add a Table block and manually enter table data:
Enter your own data, as described in How to Manually Edit Values in a Table Block
You can use dataflow to perform an operation on a table and return the result as a new table.
To create a new column that contains calculated or formatted values:
Specify the calculated or formatted value, as the from 0 property. Use JavaScript notation. For JavaScript examples, see Column Mapping.
The output table appears as the output property of the Column Mapping block.
See also Column Mapping.
To sort table rows in alphabetical or numerical order:
The sort order (ascending or descending), as the order property
The output table appears as the output property of the Sort block.
You can also use a Select Rows block to manually set the row order.
See also Sort.
To filter rows from your data:
The output table appears as the output property of the Filter block.
See also Filter.
To ensure that only one row appears in the table for each unique value:
The name of each column in the output table, as outColumn n properties.
The output table appears as the output property of the Group By block.
To combine rows based on date and time intervals instead of duplicate values, you can either use a Rollup block or use the dataInterval and rollup properties of a Load History or Multi-Histories block.
See also Group By.
To perform a join operation that combines two input tables:
The join method to use, as the join property. For descriptions, see Join.
The output table appears as the output property of the Join block.
See also Join.
To break up your data into sequential sections:
The row index on which the current page begins, as the start property.
The table portion appears as the output property of the Page block.
See also Page.
If you want, you can bind buttons to the Page block's next and previous triggers, allowing the user to page through the data. For more information about creating buttons, see Actions.
To ensure that only one row appears for each date and time interval:
The type of rollup to use, as the valueRollup property. For descriptions, see Rollup.
The output table appears as the output property of the Rollup block.
You can also use the dataInterval and rollup properties of a Load History or Multi-Histories block.
See also Rollup.
To manually include only certain rows:
With the Select Rows block selected, specify which row indexes to include, as a list of comma-separated numbers.
The output table appears as the output property of the Select Rows block.
You can also use a Select Rows block to manually set the row order.
See also Select Rows.
To transpose an input table, so that the columns in the input table become the rows in the output table:
Bind the input table to the input property of the Transpose block.
The output table appears as the output property of the Transpose block.
See also Transpose.
To monitor changes to specified values and create a table that records values as they change:
To monitor additional values, click the plus sign (+) to add name n and value n values to the block. Then, repeat steps 2 and 3.
The output table appears as the output property of the Realtime Recorder block. This table updates when the values change.
Realtime Recorder table contents are saved only in the current session.
See also Realtime Recorder.
To get a string that reflects the table records in a column:
The method of aggregation, as the method property. For descriptions, see Aggregation.
The string appears as the output property of the Aggregation block.
See also Aggregation.
Nested tables occur whenever a table stores other tables.
To view a table that is in another table:
Sometimes, you might want to unbind a table and also preserve the data that it currently holds. For example, you might want to share a dataflow model with a colleague who does not have access to your data server.
To unbind a table and preserve its data:
This section provides answers to some common questions about manipulating tables in DGLux5. These answers might be helpful when you work with charts and data grids.