5. [Builder] Transforms Project10. Generating Multiple Outputs

10 - Generating multiple outputs

This content is also available at learn.palantir.com ↗ and is presented here for accessibility purposes.

📖 Task Introduction

Let’s assume your analyst team has asked you to create distinct flight_alerts_joined_passengers datasets for each passenger country of origin that also applies additional logic to remove personal information. For example, send all rows where the passenger is from Mexico to a new dataset called flight_alerts_mexico and so forth.

You’ll first create a unique transform filtering for each country and then generate associated output datasets for each. We’ll assume here that the list of countries is static over time. If you need to dynamically generate multiple outputs for a transform, you’ll want to create a generated transform in a Code Repository. If you’d like to practice with multi-output methods in the Code Repositories application, consider following the “Repositories” track in this learning path.

🔨 Task Instructions

  1. First, what are the possible country values that need to be sorted into datasets? Click on your Alerts to Passengers transform and find the country column in the preview window at the bottom.

  2. Click the button in the column country and choose View stats. Note the 8 unique values.

  3. For each of these values, do the following:

    • Add a transform to the Alerts to Passengers transform called Country Filter: ${countryName} (e.g., Country Filter: Canada).
    • In each transform, apply a Filter on the country column that filters to the designated country.
    • After you’ve added all 8 transforms, generate output datasets for each titled flight_alerts_${countryName} (e.g., flight_alerts_canada).

    ℹ️ As you work through the bullets above, consider experimenting with the Copy within pipeline and Paste within pipeline options as shown in the brief animation below.

  4. Deploy your pipeline.