<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Using Sagemaker AutoML in an Automation in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Using-Sagemaker-AutoML-in-an-Automation/ta-p/1834957</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;This article shows how the Sagemaker connector in Qlik Application Automation can be used to leverage the AutoML features from Sagemaker AutoPilot. In this example we are using data in a CSV file to train a model using AutoML. Next we use the newly created endpoint from Sagemaker to get predictions on data in a Google Sheet. We write the predictions to a new column in the same Google Sheet and we visualize this data in a Qlik Sense app.&lt;/P&gt;
&lt;P&gt;Next, we make the automation available using a button on a sheet in the Qlik Sense app and we add an input to the automation so that the user can vary the input data, get new predictions and immediately see the visualization of these new predictions in Qlik Sense.&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Prerequisites&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;GSuite account with Google Sheet access (optional, the automation can be modified to use S3 only)&lt;/LI&gt;
&lt;LI&gt;AWS account with Sagemaker and S3 access&lt;/LI&gt;
&lt;LI&gt;Qlik Sense Enterprise account on Qlik Cloud&lt;/LI&gt;
&lt;LI&gt;Understanding of Sagemaker Autopilot&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Create an AutoML job&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We have a CSV file with input training data stored in a bucket on S3.&lt;BR /&gt;We are using this dataset for demo purposes: &lt;A href="https://datahub.io/machine-learning/bank-marketing" target="_blank" rel="noopener"&gt;https://datahub.io/machine-learning/bank-marketing&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;We're using this file to create an AutoML job in an automation using the block "Create AutoML job from S3" in the Sagemaker connector. We're using the same S3 bucket for output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sagemaker Create AutoML block" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60785i17ED658118FF939C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.22.37.png" alt="Sagemaker Create AutoML block" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sagemaker Create AutoML block&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Getting the status of the AutoML job&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Once the AutoML job is created, we'll use the "get AutoML job" block to fetch its status:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sagemaker get AutoML job block" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60786iEBA6C02C0EFBF300/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.23.52.png" alt="Sagemaker get AutoML job block" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sagemaker get AutoML job block&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It can take minutes or hours for the job to complete, we're running the Automation manually every hour or so until the AutoMLJobStatus in the response is "Completed" (bottom of screenshot):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Result of Get AutoML job" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60787iEB41C9CAAEB5D741/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.25.02.png" alt="Result of Get AutoML job" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Result of Get AutoML job&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Getting predictions from the endpoint&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We are taking note of the name of the endpoint that was created (from the "Get AutoML job" block output, or we can use the lookup feature), and we use the block "Invoke endpoint" to get prediction on one row of new CSV input data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Get a prediction from Sagemaker" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60789i07BED3C4979202D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.27.17.png" alt="Get a prediction from Sagemaker" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Get a prediction from Sagemaker&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Saving the predictions&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In the following example we have input data in a Google Sheet, we're looping over the lines in the sheet and invoking the endpoint for each line:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Getting predictions for rows in a Google Sheet" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60790i050DADEC007A0499/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.33.35.png" alt="Getting predictions for rows in a Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Getting predictions for rows in a Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that we apply the "csv" formula on the row data because we have set the content-type to text/csv.&lt;/P&gt;
&lt;P&gt;We write the prediction and probability back to the Google Sheet in a separate column Q and R:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Writing the prediction to a cell in the Google Sheet" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60791iD3A377DB7D72EA9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.35.09.png" alt="Writing the prediction to a cell in the Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Writing the prediction to a cell in the Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;We use the following json path to calculate the correct line number, needed in the input "Start Cell". We take the index of the loop (which starts with 0) and we add 2 because the first line number in Google Sheet is 1 and this contains a header line so we want to start writing on line 2:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Calculating the line number to update" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60792i6164D35807EC164C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.35.33.png" alt="Calculating the line number to update" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Calculating the line number to update&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Visualizing the data&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Finally we are doing a reload of a Qlik Sense app that visualizes the data from the Google Sheet:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Do reload of Qlik Sense app" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60793iAD4A23DCA63F1DEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.38.19.png" alt="Do reload of Qlik Sense app" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Do reload of Qlik Sense app&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that we set up a datasource in Qlik Sense pointing to the same Google sheet file as the Automation is using, in order to visualize its content:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Datasource in Qlik Sense to Google Sheet" style="width: 264px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60801iF380A6EA3284759B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.47.42.png" alt="Datasource in Qlik Sense to Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Datasource in Qlik Sense to Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;What-if simulations&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We can add an input in the Automation, to allow the user to do "what-if" simulations. In this example, we're allowing the user to change one variable, which is the "number of days since last contact":&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Automation with input for what-if simulation" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60794i3E476CE79D77BF78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.39.45.png" alt="Automation with input for what-if simulation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Automation with input for what-if simulation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the Automation, we replace one column of the data from the Google Sheet with the input that the user provided, before we send it to Sagemaker to get a prediction. We do this using a variable of type "object". First we set the variable equal to the line from the Google Sheet, and next we replace one key with the input from the user:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Variable to replace one value in the row from Google Sheet" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60795i1F43D2950C37DA2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.41.06.png" alt="Variable to replace one value in the row from Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Variable to replace one value in the row from Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Same as before, we write the prediction to a new column in the Google Sheet (as well as the user input). This is what our Google Sheet will look like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Google Sheet with predictions in green added by automation" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60796iCC79AF318CE9A29F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.43.07.png" alt="Google Sheet with predictions in green added by automation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Google Sheet with predictions in green added by automation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And at the end of the automation, again we reload the Qlik Sense app.&lt;/P&gt;
&lt;P&gt;Finally, we're adding a button on a Sheet in the Qlik Sense app, that we link to the Automation.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Button in Qlik Sense sheet linked to an automation" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60797i3F84A71F18B64322/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.45.25.png" alt="Button in Qlik Sense sheet linked to an automation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Button in Qlik Sense sheet linked to an automation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now we support a full cycle of a What-if simulation:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;User clicks the button and the Automation detail page is opened&lt;/LI&gt;
&lt;LI&gt;User enters a value for the what-if simulation when the Automation runs&lt;/LI&gt;
&lt;LI&gt;Predictions are made and the Qlik Sense app is reloaded so that the user immediately sees the result of the simulation:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Visualization of Sagemaker AutoML predictions" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60798i9F4A4C841D04CB14/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.44.52.png" alt="Visualization of Sagemaker AutoML predictions" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Visualization of Sagemaker AutoML predictions&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Download&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;See attachments to download the automation template (json file) and the Google Sheet file used in this article.&lt;/P&gt;
&lt;P&gt;In the automation editor, right mouse click on the canvas (center pane) and select "upload workspace". Next, select the json file to import the template of the automation.&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 09 Sep 2021 11:29:45 GMT</pubDate>
    <dc:creator>NikoNelissen-Qlik</dc:creator>
    <dc:date>2021-09-09T11:29:45Z</dc:date>
    <item>
      <title>Using Sagemaker AutoML in an Automation</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Using-Sagemaker-AutoML-in-an-Automation/ta-p/1834957</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;This article shows how the Sagemaker connector in Qlik Application Automation can be used to leverage the AutoML features from Sagemaker AutoPilot. In this example we are using data in a CSV file to train a model using AutoML. Next we use the newly created endpoint from Sagemaker to get predictions on data in a Google Sheet. We write the predictions to a new column in the same Google Sheet and we visualize this data in a Qlik Sense app.&lt;/P&gt;
&lt;P&gt;Next, we make the automation available using a button on a sheet in the Qlik Sense app and we add an input to the automation so that the user can vary the input data, get new predictions and immediately see the visualization of these new predictions in Qlik Sense.&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Prerequisites&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;GSuite account with Google Sheet access (optional, the automation can be modified to use S3 only)&lt;/LI&gt;
&lt;LI&gt;AWS account with Sagemaker and S3 access&lt;/LI&gt;
&lt;LI&gt;Qlik Sense Enterprise account on Qlik Cloud&lt;/LI&gt;
&lt;LI&gt;Understanding of Sagemaker Autopilot&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Create an AutoML job&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We have a CSV file with input training data stored in a bucket on S3.&lt;BR /&gt;We are using this dataset for demo purposes: &lt;A href="https://datahub.io/machine-learning/bank-marketing" target="_blank" rel="noopener"&gt;https://datahub.io/machine-learning/bank-marketing&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;We're using this file to create an AutoML job in an automation using the block "Create AutoML job from S3" in the Sagemaker connector. We're using the same S3 bucket for output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sagemaker Create AutoML block" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60785i17ED658118FF939C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.22.37.png" alt="Sagemaker Create AutoML block" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sagemaker Create AutoML block&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Getting the status of the AutoML job&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Once the AutoML job is created, we'll use the "get AutoML job" block to fetch its status:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sagemaker get AutoML job block" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60786iEBA6C02C0EFBF300/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.23.52.png" alt="Sagemaker get AutoML job block" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sagemaker get AutoML job block&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It can take minutes or hours for the job to complete, we're running the Automation manually every hour or so until the AutoMLJobStatus in the response is "Completed" (bottom of screenshot):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Result of Get AutoML job" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60787iEB41C9CAAEB5D741/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.25.02.png" alt="Result of Get AutoML job" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Result of Get AutoML job&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Getting predictions from the endpoint&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We are taking note of the name of the endpoint that was created (from the "Get AutoML job" block output, or we can use the lookup feature), and we use the block "Invoke endpoint" to get prediction on one row of new CSV input data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Get a prediction from Sagemaker" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60789i07BED3C4979202D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.27.17.png" alt="Get a prediction from Sagemaker" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Get a prediction from Sagemaker&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Saving the predictions&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In the following example we have input data in a Google Sheet, we're looping over the lines in the sheet and invoking the endpoint for each line:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Getting predictions for rows in a Google Sheet" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60790i050DADEC007A0499/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.33.35.png" alt="Getting predictions for rows in a Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Getting predictions for rows in a Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that we apply the "csv" formula on the row data because we have set the content-type to text/csv.&lt;/P&gt;
&lt;P&gt;We write the prediction and probability back to the Google Sheet in a separate column Q and R:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Writing the prediction to a cell in the Google Sheet" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60791iD3A377DB7D72EA9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.35.09.png" alt="Writing the prediction to a cell in the Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Writing the prediction to a cell in the Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;We use the following json path to calculate the correct line number, needed in the input "Start Cell". We take the index of the loop (which starts with 0) and we add 2 because the first line number in Google Sheet is 1 and this contains a header line so we want to start writing on line 2:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Calculating the line number to update" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60792i6164D35807EC164C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.35.33.png" alt="Calculating the line number to update" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Calculating the line number to update&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Visualizing the data&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Finally we are doing a reload of a Qlik Sense app that visualizes the data from the Google Sheet:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Do reload of Qlik Sense app" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60793iAD4A23DCA63F1DEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.38.19.png" alt="Do reload of Qlik Sense app" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Do reload of Qlik Sense app&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that we set up a datasource in Qlik Sense pointing to the same Google sheet file as the Automation is using, in order to visualize its content:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Datasource in Qlik Sense to Google Sheet" style="width: 264px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60801iF380A6EA3284759B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.47.42.png" alt="Datasource in Qlik Sense to Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Datasource in Qlik Sense to Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;What-if simulations&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We can add an input in the Automation, to allow the user to do "what-if" simulations. In this example, we're allowing the user to change one variable, which is the "number of days since last contact":&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Automation with input for what-if simulation" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60794i3E476CE79D77BF78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.39.45.png" alt="Automation with input for what-if simulation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Automation with input for what-if simulation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the Automation, we replace one column of the data from the Google Sheet with the input that the user provided, before we send it to Sagemaker to get a prediction. We do this using a variable of type "object". First we set the variable equal to the line from the Google Sheet, and next we replace one key with the input from the user:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Variable to replace one value in the row from Google Sheet" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60795i1F43D2950C37DA2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.41.06.png" alt="Variable to replace one value in the row from Google Sheet" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Variable to replace one value in the row from Google Sheet&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Same as before, we write the prediction to a new column in the Google Sheet (as well as the user input). This is what our Google Sheet will look like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Google Sheet with predictions in green added by automation" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60796iCC79AF318CE9A29F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.43.07.png" alt="Google Sheet with predictions in green added by automation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Google Sheet with predictions in green added by automation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And at the end of the automation, again we reload the Qlik Sense app.&lt;/P&gt;
&lt;P&gt;Finally, we're adding a button on a Sheet in the Qlik Sense app, that we link to the Automation.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Button in Qlik Sense sheet linked to an automation" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60797i3F84A71F18B64322/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.45.25.png" alt="Button in Qlik Sense sheet linked to an automation" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Button in Qlik Sense sheet linked to an automation&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now we support a full cycle of a What-if simulation:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;User clicks the button and the Automation detail page is opened&lt;/LI&gt;
&lt;LI&gt;User enters a value for the what-if simulation when the Automation runs&lt;/LI&gt;
&lt;LI&gt;Predictions are made and the Qlik Sense app is reloaded so that the user immediately sees the result of the simulation:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Visualization of Sagemaker AutoML predictions" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/60798i9F4A4C841D04CB14/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-08-26 at 16.44.52.png" alt="Visualization of Sagemaker AutoML predictions" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Visualization of Sagemaker AutoML predictions&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;Download&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;See attachments to download the automation template (json file) and the Google Sheet file used in this article.&lt;/P&gt;
&lt;P&gt;In the automation editor, right mouse click on the canvas (center pane) and select "upload workspace". Next, select the json file to import the template of the automation.&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Sep 2021 11:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Using-Sagemaker-AutoML-in-an-Automation/ta-p/1834957</guid>
      <dc:creator>NikoNelissen-Qlik</dc:creator>
      <dc:date>2021-09-09T11:29:45Z</dc:date>
    </item>
  </channel>
</rss>

