Registered users of this product or Trifacta Wrangler Enterprise should login to Product Docs through the application.
Uses one row from the dataset sample as the header row for the table. Each value in this row becomes the name of the column in which it is located. This transform might be automatically applied as one of the first steps of your recipe. See Initial Parsing Steps.
NOTE: If source row number information is not available due to changes in the dataset, this transform may not be available.
Output: The values from Row #4 of the original dataset are used, if available, as the names for each column. If the row is not available, the specified row data can be retrieved, and the transform fails.
|Parameter||Required?||Transform Builder||Data Type||Description|
|sourcerownumber||N||Row number||integer (positive)||Row number from the original data to use as the header. If not specified, the current row #1 is used.|
For more information on syntax standards, see Language Documentation Syntax Notes.
sourcerownumber parameter defines the row number to apply to the transform step.
This parameter references the original row number of the sample in the dataset.
sourceownumberparameter must be an integer that is less than or equal to the total number of rows in the original sample.
- If the corresponding row has been deleted from the dataset, the transform step generates an error.
sourcerownumber parameter is specified, the first row in the dataset is used for the header values.
NOTE: In some cases, the source row number information might no longer be available. See SOURCEROWNUMBER Function.
Output: Uses row #4 from the source row numbers of the sample as the header the columns.
Example - Header from row that is not the first one
You have imported the following racer data on heat times from a CSV file. When loaded in the Transformer page, it looks like the following:
|1||Racer||Heat 1||Heat 2||Heat 3|
In the above, the
(rowId) column references the row numbers displayed in the data grid; it is not part of the dataset. This information is available when you hover over the black dot on the left side of the screen.
You have sorted the heat time columns a few times to exam the best performance in each heat according to the sample. You then notice that the data contains headers, and you forget how it was originally sorted. The data now looks like the following:
|2||Racer||Heat 1||Heat 2||Heat 3|
Tip: In the above example, the row numbers remain unchanged despite the sort steps. To assist with sorting operations, you might find it useful to enable this option under the data grid options. See Transformer Page.
While you can undo your sort steps to return to the original sort order, this approach works best if you did not include other steps in between that are based on the sort order.
If you have steps that require retaining your sort steps, you can revert to the original sort order by adding this transform step:
Then, you can create the header with the following simple step:
If you need to retain the sort order and not revert to the original, you can do the following to the previous example data:
After you have applied the last
header transform, your data should look like the following:
You can sort by the
Racer column in ascending order to return to the original sort order.
This page has no comments.