Column from Examples

Let’s use the Column from examples function to build a new column containing the item code and a shortened item description.

  1. Select the StockItems query

  2. Hold down CTRL to select the StockItemID and StockItemName columns.

  3. Go to the Add Column tab and click From Selection from the Column from Examples drop-down. Column from examples

  4. In the first row of Column1, type the first StockItemID, followed by a space and then the first part of the StockItemName.

    For example, the row 1 value looks like this: { 1 USB missile launcher }

    Hit Enter then repeat this on row 2: { 1 USB rocket launcher }

    And for row 3 enter: { 3 Office cube periscope } Custom Column from examples

    Notice how the two columns are being concatenated into the new column all the way down, based on the examples you typed.
    The description is also being trimmed of the item colour text.

  5. Click OK to complete the new column, then right click the new Custom column heading and rename as ItemIdShortName.

    Examine the new column and note how the transformation has been applied to every row.

  6. Now click on the ‘cog’ beside the Added Custom Column step to see the code that was created in the Column from examples function: Added Custom Column Note the complex code that was automatically created to achieve the creation of your new column: Custom Column Click OK

  7. To apply this change, go to Home or File tab > Hit Close & Apply. Apply Save your work.




End of Lab 1