Data operations in MashZone Next Gen
MashZone NextGen provides a wide range of data transformation operators for creating dashboards and data feed definitions. A data source operator enables you to specify the connection to a data source and to configure the data retrieval.
In this article we are going to explain how to use few data transform operations with examples.
1. Extract text and Column To value operations:
2. Filter rows and Insert column operations
3. Named Copy operation
Extract text and Column To value operations:
Extract text: Creates an extract from each value in a text column starting from the specified position (start index) and with the specified length and writes the result to a target column. Searches the source column at the specified start index and using the specified length for the string and displays it in the target column. Start index and length must be >= 0, otherwise an empty entry appears in the target column.
Column To value: Takes a single value from a data feed column. If the column contains multiple values, the first value found is returned.
Consider that the data displayed from the data feed is in one form for example CBL-Cross-20181123.In this example, year is displayed first and then month and days. But we want to display it as CBL-Cross-23-11-2018 i.e. days first and then month, year.
Below is step by step process to display data as CBL-Cross-23-11-2018 from CBL-Cross-20181123 using Data Operations.
- As shown in the screen shot the data feed displays the data as CBL-Cross-20181123
2. First we will extract the text from the column using the “Extract text” data operation. In “Extract text” operation start index is mentioned i.e., from which point the extraction should begin .Length is also mentioned i.e., till which point the data should be extracted. In the below screen shot “CBL-Cross” is being extracted and Start Index is mentioned as zero and Length is mentioned as 9.Since the “Extract text” operation displays all the columns along with Result_1 column. So “Column To value” operation is used which takes a single value i.e., “CBL-Cross” from a data feed Column. And “Value to column” is used which converts an individual value “CBL-Cross” into a column so that it can be connected to an operator in the coming steps.
3.In this step we will extract the “date” from the column using the “Extract text” operation. Here the starting index of the date is 16 and length is 2.And the extracted is stored in Result_1 column.
4.Similarly month and year are also extracted using the “Extract text” operation.
5.In the final step all the extracted data are concatenated using the “Concatenate texts” operation as shown below. And the end result is displayed using the “Output” operation which displays output as CBL-Cross-23-11-2018 which has been converted from CBL-Cross-20181123.
Filter rows and Insert column operations:
Filter rows: Filters the data feed one row at a time using particular conditions.Insert column: Inserts new columns of Text, Number, or Date data type into the data feed. Each of the columns can be populated with an initial value.
Consider that the JDBC feed displays large amount of data but we need only few data to be displayed. In that case we will use “Filter rows” which will display. In this example we will display the information related to only seven users instead of hundred’s users information using “Filter rows” operation.
Then we will use “Insert column” operation which will insert a new column. In this example Column name “Count” is inserted and Type is selected as number which will display the results along with the count.
Named Copy operation:
This operation is used to copy the data from operation and pass it as parameter in another operation.
In the below example, Named copy operation is used to copy the value from “Column to value” operation and saved with parameter name “TestCyleNumber”. Then this parameter is passed in another operation. So whenever this kind of data feed is used, first a value is stored in TestCyleNumber using the Data feed operation then the other operation JDBC is executed by using the value which comes along with TestCyleNumber.