製品ガイド

SQL ユーザーのための Alteryx ガイド

 

Alteryx SQL

データへのアクセスやデータの準備に対する旧来のアプローチは多くの時間を要するものとなりがちです。こうした状況に頭を抱えるアナリストの中には、IT や SQL の開発者に頼らずに、自ら問題に対処し、SQL のコーディングを学ぶ人もいるほどです。SQL を書く際にアナリストが直面する最大の問題の 1 つは、SQL を無事に動作させることです。SQL にはオートコレクト機能がないため、ピリオドやカンマを打ち間違えたとしても、自動的に検出されないため、時間をかけて書いたスクリプトが無駄になってしまう恐れさえあります。

 

Alteryx では、最先端のワークフローベースのアプローチにより、非構造化データを含むあらゆるデータソースからのデータを簡単に準備、ブレンド、分析することができます。そのため、コードのテストやデバッグに時間を費やすのではなく、反復可能なワークフローを構築し、他のアナリストや IT 部門、ビジネスの意思決定者など、あらゆるステークホルダーとデータの抽出や変換の方法を正確に共有することができます。これにより、コーディングにかかる時間を大幅に短縮するだけでなく、透明性と一貫性を高めることが可能となっています。

 

このガイドでは、SQL でコーディングされることの多い一般的なデータ関連のプロセスのいくつかをリストアップし、Alteryx で同様のプロセスを実行する方法を解説します。SQL に関する知識を Alteryx のワークフローでどのように活用できるのか、さまざまな例を交えながら理解を深めていただける内容となっていますので、ぜひご活用ください。

 
 

セレクト

SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY

In SQL

In Alteryx

 

To access data in Alteryx, you drag and drop an Input Data Tool onto the canvas, locate the database, and simply select.
In this example, the Input Data Tool lets you connect to an SQL Server Database.

Using the Select Tool allows you change the data type, select/deselect fields, or simply rename the fields to whatever you want. In this case, Customer ID is the field name.

 

In Alteryx, combining multiple datasets is easy with the Join Tool.

The Join Tool allows you to join two tables with a common field (primary key) and Alteryx automatically returns three sets of records:

  • Inner Join (J): the columns from the source table (L) joined with the columns in the table to join (R), matching records based on the common field(s)
  • Left unjoined (L): the records of the original table (L) that have not found a match in the table to join (R)
  • Right unjoined: (R): the records of the table to be joined (R) that have not found a match in the source table (L)

Here is a Join on Customer ID.


In addition to the Join Tool, Alteryx also has an In-Database Join Tool. This enables blending and analysis against large sets of data without moving the data out of the database, and provides significant performance improvements over traditional analysis methods.

The In-Database Join Tool lets you do inner, left outer, right outer, and full outer joins.

Learn more about Alteryx In-Database tools here.


 The Union Tool allows you to combine multiple sets of records based on the field name or position of each column. You can easily change the order of the column headers in each set of records so they match up.

Here, two sets of records — the left un-joined records and the (inner) joined records — are joined together, producing a left outer join.

 

Limiting records based on specific criteria is performed using the Filter Tool. Filtering can use anything from simple comparisons to complicated, conditional statements. In this example only those records that do not contain the country United States are filtered.

 

In Alteryx, the Summarize Tool lets you collect data across multiple records, apply an aggregate function, and group the results by one or more fields.

In this example, the Summarize Tool lets you group by country (e.g., United Kingdom, Germany), and average the total amount per country.

You can limiting records based on specific criteria using the Filter Tool. Filtering can use anything from simple comparisons all the way to complicated, conditional statements. This example shows only those records that have average totals greater than or equal to 1000.

 

The Sort Tool in Alteryx allows you to order your data just the way you need it. Select the name(s) of the column(s) and choose between ascending or descending. In this example, the Average Total Amount is shown in Descending order.

 


SQL の SELECT 分に対応する Alteryx ワークフローです。

 
 

クロス 結合

クロス 結合

In SQL

In Alteryx

Using the Append Fields Tool, you can append the fields from a source input to every record of a target input. Each record of the target input will be duplicated for every record in the source input. In this example, all Distribution Center records are appended to each Customer record.

 

流通センターのレコードを各顧客レコードに追加する Alteryx ワークフローです。

 
 

Where Between

Where Between

In SQL

In Alteryx

You can limit records to those that have field values within a specific range using the Alteryx Filter Tool. In this example the filter is Order Dates between December 1 – 31, 2016, inclusive.

 

2016 年 12 月 1 日 ~ 31 日の間に発注された注文の顧客注文データをフィルタリングする Alteryx ワークフローです。

 
 

Where In

Where In

In SQL

In Alteryx

To limiting records to those with field values belonging to a set of possible alternatives, use the Alteryx Filter Tool. In this example, the filter is set to customers whose country is either the United States or the United Kingdom.

 

米国または英国の顧客のフィルタリングを行うための Alteryx ワークフローです。

 
 

Distinct

Distinct

In SQL

In Alteryx

The Unique Tool in Alteryx helps separate data into two streams, duplicate and unique records, based on the fields you choose. The field chosen in this example is country.

 

Distinct

この Alteryx ワークフローでは、ユニークツールを用いて、選択したフィールド(この例では「国」)に基づいて、データを 2 つのストリーム(重複したレコードと固有のレコード)に分けています。

 

おすすめのリソース

 
ブログ記事
Reflections from the MIT Sloan Sports & Analytics Conference
  • データ準備と分析
  • Fanalytics
  • アナリスト
今すぐ読む
 
電子書籍
「疲れる」から「繋がる」へ:コーディングでのデータ変換とDesigner Cloudでのデータ準備
この電子書籍では、視覚的で分かりやすいガイダンスに沿ってデータ準備を簡単に自動化・高速化し、より迅速にインサイトを手に入れることができるAlteryx Designer Cloudについて解説します。
  • データサイエンスと機械学習
  • データ準備と分析
  • アナリスト
今すぐ読む
 
電子書籍
6 Steps To A Bulletproof Data Prep Strategy
From exploring to wrangling, prep your way to better insights
  • 分析の自動化
  • データ準備と分析
  • プロセスの自動化
今すぐ読む