Guided Learning
This chapter explores workflows in DataChat using the dataset "titanic". For this example, we'll perform an analysis on ticket fares.
Load the "titanic" Dataset
To begin, let's open a new session:
Open DataChat and from the homepage, launch a new session.
Load the file "titanic.csv" from files included with DataChat. Click Load in the sidebar, then click load data from my files and select "titanic.csv".
By default, new sessions open in Grid mode. To adjust these settings, see Set default mode and Automatically enlarge charts and some tables in Grid Mode.
Wrangle and Plot with "titanic"
Let's clean our data by removing unneeded columns. Click Column > Drop from the sidebar and select "PassengerId" and "Ticket".
The new dataset titanic v2 appears in the dataset panel, and doesn't include the dropped columns.
Let's compute the average ticket cost based on a passenger's class. Click Dataset > Compute in the sidebar and select "average" for the aggregate, "Fare" for the column, "AvFare" for the new column name, and "Pclass" for columns to group by. Click Submit.
When we use the
Compute
skill on a dataset, DataChat appends the original dataset name with "_Compute". The new dataset, "titanic_Compute v1", contains the computed values and appears in the dataset panel.Let's make the current dataset "titanic v2", by clicking on it in the dataset panel.
Let's create a chart to compare "Age" and "Fare". Click Plot in the sidebar to open the Chart Builder. Select "Bar Chart" for the chart type, "Age" for the x-axis, and "Fare" for the y-axis.
The bar chart is created and appears under the chart panel.
Save Session as a Workflow
Let's save this session as a workflow. Click Save in the sidebar, select Workflow, enter the workflow name "Titanic_Fare_Analysis", and select Yes to overwrite any existing workflows with the same name. Click Submit.
The workflow is displayed as an interactive flow chart that displays the DataChat sentences required for the plot.
Click the X in the top-right corner to return to the session and then return to the homepage by clicking the DataChat logo in the top left corner.
The unnamed session and the workflow appear in the Recent section. We can also click Workflows in the sidebar to see all of our workflows.
Edit Titanic_Fare_Analysis
Let's edit our workflow. Select "Titanic_Fare_Analysis", then click the Edit Workflow button from the menu to open the Workflow Editor.
The Editor shows each utterance used within your session, with exception of a few, and allows you to add, remove, or edit your utterances.
Let's add an additional computation to show the number of records where Fare is greater than $75. From the Editor, we'll click on the third line,
Compute the average Fare for each Pclass and call the computed columns AvFare
, then click Enter to create a new line beneath it. Then, we can enterCompute the count of records where Fare is greater than 75
.The edited workflow needs to be tested to ensure it's valid. Click Restart > Continuous in the sidebar. The entire workflow is run, and the results of each sentence appear in the Workflow Editor replay panel.
The green check to the left of the workflow name indicates that the edited workflow replayed successfully.
Share Titanic_Fare_Analysis
Now that we've edited the workflow, let's share it with another user in our organization. From the homepage, right-click on the workflow "Titanic_Fare_Analysis" in the Recent section and click Share to open the Share form. Enter the name of a user in your organization, select whether the user should be a Viewer or an Editor, and click Save.
Schedule Titanic_Fare_Analysis to Replay
Let's schedule this workflow to replay on the "titanic" dataset each Monday morning. We can do this by returning to the homepage, then opening our original session.
From here, we can open the chat box in the lower right corner and enter:
Schedule the workflow replay for Titanic_Fare_Analysis on Mondays at 8:00 EST
Now, every Monday at 8:00 EST, the workflow Titanic_Fare_Analysis
will automatically replay.
If we want to stop replaying the workflow every Monday we can use the Delete
skill by entering:
Delete the scheduled workflow replay for Titanic_Fare_Analysis on Mondays at 8:00 EST