|Creation date||Minimum version|
The Windowing extension is useful for determining how data changes from one row to another. It uses the SQL Lead and Lag functions. You can run the Windowing extension on multiple columns.
Follow these steps to use the Windowing extension:
- In the My Extensions panel, select the Windowing extension.
The following table describes each field in the modal window:
Field Description Window On Names of the selected columns on which you run the SQL Lead or Lag function. Each column contains values that change from row to row, and you are interested in analyzing the changes. Data type of the column must be integer, float, or string. Sort On Column on which you sort the table. Sorting is necessary before you can compare data from different rows. Data type of the column must be integer, float, or string. Sort order Ascending or descending. Lag If you want to compare data to a previous row after the sort, fill out this field. For example, type 1 to compare the current row to the one immediately before it, type 2 to compare the current row to the one that is 2 rows before, and so on. If you do not use this function, type 0 in this field. Lead If you want to compare data to the next row after the sort, fill out this field. For example, type 1 if you want to compare the current row to the one immediately after it, type 2 to compare the current row to the one that is 2 rows after, and so on. If you do not use this function, type 0 in this field.
- Click APPLY. A new table containing the columns specified in the panel is created. It also contains an additional column with the data in another row, depending on how you specify the Lag or Lead value.
Example of the Windowing extension
In the table named Disk, the columns Timestamp and Data_read show the time of each read access to a storage system and the amount of data read, respectively. The following is the Disk table:
Suppose you want to know by how much the data read changes from one timestamp to the next, fill out the fields in the Windowing modal window as follows:
The Windowing extension creates the following table:
In this new table, the Timestamp and Data_read columns are renamed with orig_ prepended. The table is sorted by timestamp. The new column, lead_1_Data_read, contains the orig_Data_read value in the following row. This new column enables you to analyze the changes of data read over time. For example, to find out how much the data amount changes between two timestamps, invoke the subtraction function in the Map operation by entering the following in the function bar: