Before you Begin

This 10-minute tutorial shows you how to specify parameters in a data flow that prompt for the input data source, output dataset, or both before executing the data flow.

Background

You use data flows to apply transformations to datasets, add joins between datasets, add filters, remove unwanted columns, add derived measures and columns, and perform other operations such as sentiment analysis and time series forecast.

If you implement parameter prompts in your data flow, you can reuse the data flow without editing it directly. To use the same data flow, the input data source must use the same structure, but with different data records, as the data source originally used to create the data flow.

If you schedule a data flow, the prompts appears before the job runs.

What Do You Need?

Create Datasets

In this section, you create three datasets using the spreadsheets that you downloaded to your computer.

  1. Sign in to Oracle Analytics Cloud.
  2. On the Home page, click Create, and then click Dataset. In Create Dataset, click Drop data file here or click to browse. In File Upload, select orders_5.xlsx file, and then click Open.
  3. In Create Dataset Table from orders_5.xlsx, click OK. Click Save Save icon. In Save Dataset As, enter orders_5 in Name, and then click OK.
  4. In the Join Diagram, use the scroll bar to review the columns. Click Go back back icon to return to the Home page.
  5. On the Home page, click Create, and then click Dataset. In Create Dataset, click Drop data file here or click to browse. In File Upload, select orders_6.xlsx file, and then click Open.
  6. In Create Dataset Table from orders_6.xlsx, click OK. Click Save Save icon. In Save Dataset As, enter orders_6 in Name, and then click OK.
  7. In the Join Diagram, use the scroll bar to review the columns. Click Go back back icon.
  8. On the Home page, click Create, and then click Dataset. In Create Dataset, click Drop data file here or click to browse. In File Upload, select states.xlsx file, and then click Open.
  9. In Create Dataset Table from states.xlsx, click OK. Click Save Save icon. In Save Dataset As, enter states in Name, and then click OK.
  10. In the Join Diagram, use the scroll bar to review the columns. Click Go back back icon.


    Description of data_sets.png follows
    Description of the illustration data_sets.png

Create a Data Flow

  1. On the Home page, click Create, and then click Data Flow. In Add Data, select orders_5, and then click Add.
  2. Drag Add Data from the Data Flow Steps panel to Add a step Add a step icon in the data flow editor.
  3. In Add Data, click the states dataset, and then click Add.


    The datasets are automatically joined on the city column in each dataset.

    Description of auto_join.png follows
    Description of the illustration auto_join.png
  4. Click Add a step Add a step icon on the Join node, and then click Rename Columns.
  5. In Rename Columns, scroll to Customer Segment, and delete Customer to change the column name to Segment.
  6. Click Add a step Add a step icon on the Rename Columns node, and then click Merge Columns.
  7. In Merge Columns, enter City_State in New column name. Next to Merge column, click the hyperlink (Order Line ID), and then select City. Next to With, click the hyperlink (Order Line ID), and then select State. From the Delimiter list, select Comma (,).


    Description of merge_columns.png follows
    Description of the illustration merge_columns.png
  8. Click Add a step on the Merge Columns node, and then click Save Data. In Name, enter Sales Orders. Click Save, and then select Save As. In Save Data Flow As, enter Sales_Orders, and then click OK. Click Save.


    Description of sales_orders_dataflow.png follows
    Description of the illustration sales_orders_dataflow.png
  9. Click Run Data Flow to make sure that the data flow is valid.

Run the Data Flow with a Different Dataset

You can reuse a data flow with datasets that contain the same data as the original dataset. In this tutorial, the original dataset is orders_5.

  1. In the Sales_Orders data flow, click the orders_5 node. In order_5 node details, click When Run Prompt to select Dataset. In Name, use the default value. In Prompt, enter Select the data source.


    Description of select_dataset_prompt.png follows
    Description of the illustration select_dataset_prompt.png
  2. Click Save. Click Run Data Flow. In Dataflow Prompt, click the orders_5 hyperlink.


    Description of dataflow_prompt_source.png follows
    Description of the illustration dataset_prompt_source.png
  3. In Add Data, click orders_6, and then click Add. In Dataflow Prompt, click OK.

    The data flow executes with the selected dataset.

  4. After the message, Data Flow "Sales Orders" complete appears, click Go back back icon to return to the Home page.
  5. In the Home page, click Data in the search bar, enter Sales Orders, and the click Search.
  6. In the Sales Orders dataset, click the Actions menu Actions menu icon, and then select Inspect.
  7. In the dataset page, click Data Elements to review the output from the data flow. Click Close.

Create a New Target from the Data Flow

In this section, you specify a prompt to create a new dataset when the data flow runs.

  1. On the Home page, select the Sales_Orders_DF, click the Actions menu Actions menu icon, and then click Open.
  2. In the Sales Orders data flow, click the Save Data node. In Save Data node details, click When Run Prompt to specify Dataset. In Name, use the default value. In Prompt, enter the phrase Enter target name.


    Description of target_parameter.png follows
    Description of the illustration target_parameter.png
  3. Click Save. Click Run Data Flow.
  4. In Enter Target Name, enter My Sales, and then click OK.


    Description of dataflow_prompt_target.png follows
    Description of the illustration dataflow_prompt_target.png
  5. After the message, Data Flow "My Sales" complete appears, click back back icon to return to the Home page.
  6. In the Home page, click Data in the search bar, enter My Sales, and the click Search.
  7. In the My Sales dataset, click the Actions menu Actions menu icon, and then select Inspect.
  8. In the dataset page, click Data Elements to review the output from the data flow.

Learn More