...
概要
Wiki Markup |
---|
{html}<iframe width="700" height="394" src="https://www.youtube.com/embed/CyUgmM4PmBI?color=white" frameborder="0" allowfullscreen></iframe>{html} |
はじめに
Introduction
In this tutorial, we will walk through setting up an append sub query in order to compare two years worth of figures.
A good way to think about Appends is - use them if you need to add a column to a report that requires filters different to the rest of the report.
In this scenario our main report will look at invoice figures by country in 2014. The column we want to add is the invoiced figures in 2013. The filters Year = 2014 and Year = 2013 conflict, so the additional column will have to be added through the append.
Master Query
The Master Query is going to include:このチュートリアルでは、2年分の数値を比較するために追加サブクエリーを設定する処理を、段階的に説明します。
追加は、レポートのその他の部分とは異なるフィルターを必要とするカラム(列)をレポートに追加する場合に使用するものと考えるとよいでしょう。
このシナリオのメインレポートでは、2014年における国別の請求額を表示します。追加するカラム(列)は、2013年の請求額です。フィルターYear = 2014とYear = 2013が競合するため、追加を使用して別のカラム(列)を加える必要があります。
マスタークエリー
マスタークエリーには以下の項目を含めます。
- Athlete Country
- Sum Invoiced Amount
- Filter: Year フィルター:Year = 2014
This will mean that we have Country as a common field for 2014 and 2013 so this will form our join when we add the Append.
Note: sometimes you will have a case where you don't wish to filter the Country list by 2014, this may be because some countries have no results for 2014 yet. In this case you would have Country in the Master Query, and an Append Query for each Invoiced Amount.
Append Query
The Append Query will include:
...
この場合、「Country」は2014年と2013年の共通フィールドであるため、追加を加えると結合が行われます。
注意: 一部の国にはまだ2014年に対する結果が存在しないという理由などから、「Country」一覧を2014年でフィルタリングしたくない場合もあります。この場合は、マスタークエリーに「Country」を含め、それぞれの「Invoiced Amount」のために追加クエリーを使用します。
追加クエリー
追加クエリーには以下の項目を含めます。
- 結合:Athlete Country
- Sum Invoiced Amount
- Filter: Year フィルター:Year = 2013
This will be joined to the Master Query using the Athlete Country field. The query will be filtered by Year = 2013, and will include a copy of the Sum Invoiced Amount field to be filtered.
...
この追加クエリーは、「Athlete Country」フィールドを使用してマスタークエリーに結合されます。クエリーはYear = 2013でフィルタリングされ、フィルター対象となる「Sum Invoiced Amount」フィールドのコピーがクエリーに組み込まれます。
初期化
Section |
---|
Column |
---|
| 1. Click on the Create link and select Report to begin building your report. 「作成」リンクをクリックして、「レポート」を選択しレポートの作成を開始します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/attachments/2327027/01create.png?version=1&modificationDate=1409167134059&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 2. You should now be on the Initialise Report page. Select the Drag and Drop Builder as the build tool. 「新規レポート作成」ページが表示されます。作成ツールとして「ドラッグ&ドロップビルダー」を選択します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/attachments/2327027/02builderType.png?version=1&modificationDate=1409167133894&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 3. Select ビューとして「Ski Team as the View.」を選択します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/03view.png?version=1&modificationDate=1409167133713&cacheVersion=1&api=v2)
|
|
...
マスタークエリー
Section |
---|
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/04fields.png?version=1&modificationDate=1409167132981&cacheVersion=1&api=v2)
|
|
...
追加クエリー
...
追加の作成
Section |
---|
Column |
---|
| 6. Click on the + button in the Sub Query panel to the left of the Data step to add a Sub Query. 7. Set the Type to Append and Style to Basic. 8. Click Ok to set up the query.「データ」ステップの左側にある「サブクエリー」パネルで「+」ボタンをクリックし、サブクエリーを追加します。 7. 「タイプ」を「追加」に、「スタイル」を「基本」に設定します。 8. 「OK」をクリックしてクエリーを設定します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/05addSQ.png?version=1&modificationDate=1409167132472&cacheVersion=1&api=v2)
|
|
...
追加の結合
Section |
---|
Column |
---|
| The first thing you will need to define, when setting up a sub query, is the join type, and join fields. 9. Ensure the join type is Left Outer Join. 10. Select the Athlete Country field in the Master Query Fields drop down list. This is the field you wish to join the Sub Query to. 11. Drag the Athlete Country field in to the *Sub Query Fields box in order to join it to the Master Query.サブクエリーを設定する際に最初に定義する必要があるのは、結合タイプと結合フィールドです。 9. 結合タイプを「左外部結合」に設定します。 10. 「マスタークエリーフィールド」ドロップダウンリストで、「Athlete Country」フィールドを選択します。このフィールドにサブクエリーを結合します。 11. 「Athlete Country」フィールドを*「サブクエリーフィールド」ボックスにドラッグして、マスタークエリーに結合します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/06join.png?version=1&modificationDate=1409167132769&cacheVersion=1&api=v2)
|
|
...
フィルター
Section |
---|
Column |
---|
| 12. Add the Year field to the Sub Query Filters box. This filter will be used to restrict results of the sub query only. 「Year」フィールドを「サブクエリーフィルター」ボックスに追加します。このフィルターは、サブクエリーの結果を制限するためにのみ使用されます。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/07filter.png?version=1&modificationDate=1409167132874&cacheVersion=1&api=v2)
|
|
...
サブクエリー名と保存
Section |
---|
Column |
---|
| 13. Change the name of the Sub Query to Previous Year. This will later help identify the sub query, especially useful if you have multiple sub queries.14. Save the Sub Query.サブクエリーの名前をPrevious Yearに変更します。このように変更しておくと、あとでサブクエリーを識別する場合(特に、複数のサブクエリーが存在する場合)に役立ちます。 14. サブクエリーを保存します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/08nameSave.png?version=1&modificationDate=1409167133174&cacheVersion=1&api=v2)
|
|
...
カラム(列)の追加
Section |
---|
Column |
---|
| 15. Drag and drop the 「 Invoiced Amount metric into the Columns list.」メトリックを「カラム(列)」一覧にドラッグ&ドロップします。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/09ddColumn.png?version=1&modificationDate=1409167133269&cacheVersion=1&api=v2)
|
|
...
設定の編集
Section |
---|
Column |
---|
| 16. If you need to make changes to your sub query setup at all, click the Edit Settings link. クエリー設定を変更する必要がある場合は、「設定の編集」リンクをクリックします。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/attachments/2327027/10settings.png?version=1&modificationDate=1409167133079&cacheVersion=1&api=v2)
|
|
...
フィルターの適用
Section |
---|
Column |
---|
| 17. Once your sub query is ready, navigate back to the Master Query by clicking on it in the sub query panel on the left of the page. サブクエリーの準備が整ったら、ページの左側にある「サブクエリー」パネルで「マスタークエリー」をクリックして戻ります。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/attachments/2327027/11queryList.png?version=1&modificationDate=1409167133542&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 18. Click on the Settings link in the Filters panel. This will allow you to configure logic and values for all filters. 「フィルター」パネルで「設定」リンクをクリックします。これにより、すべてのフィルターについてのロジックおよび値を設定することができます。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/attachments/2327027/12filterSettings.png?version=1&modificationDate=1409167133359&cacheVersion=1&api=v2)
|
|
...
マスターフィルター
Section |
---|
Column |
---|
| 19. Set the Master Query filter to be Year Equal to 2014 by clicking on the funnel icon. 「マスタークエリー」フィルターを「Year 等しい(=)2014」となるように設定します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/13filterMaster.png?version=1&modificationDate=1409167134228&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 20. Select 2014 and click submit 「2014」を選択して「送信・実行」をクリックします。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/14masterValue.png?version=1&modificationDate=1409167134146&cacheVersion=1&api=v2)
|
|
...
サブクエリーフィルター
Section |
---|
Column |
---|
| 21. Navigate to the sub query filters by clicking on the 「Previous Year tab.」タブをクリックして、サブクエリーフィルターに移動します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/15appendValue.png?version=1&modificationDate=1409167133976&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 22. Click on the x on the filter panel to close it. Be sure not to click on the X to close the report builder. フィルターパネルの「x」をクリックしてパネルを閉じます。レポートビルダーを終了するための「X」をクリックしないようにしてください。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/16closeFilters.png?version=1&modificationDate=1409167133795&cacheVersion=1&api=v2)
|
|
...
書式
Section |
---|
Column |
---|
| 23. Click on the first 最初の「Sum Invoiced Amount field's drop down list and select Format.」フィールドのドロップダウンリストをクリックして、「書式」を選択します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/17format.png?version=1&modificationDate=1409167134564&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 24. Change the Display name to Invoiced 2014. It's important to do this to provide the user with some context to help differentiate between the queries. 「表示」の名前をInvoiced 2014に変更します。このように変更しておくと、ユーザーがクエリーを区別する場合に手掛かりとして役立つため、重要です。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/18current.png?version=1&modificationDate=1409167134473&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 25. While still in the Column Formatting menu, select the 「カラム(列)の書式」メニューが表示されているときに、左側の一覧から「Sum Invoiced Amount field from the list on the left.」フィールドを選択します。 26. Set the name to 名前をInvoiced 2013 and close the menu.と設定して、メニューを閉じます。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/19previous.png?version=1&modificationDate=1409167134395&cacheVersion=1&api=v2)
|
|
...
保存
Section |
---|
Column |
---|
| 27. Click Report > Save to activate your report. 「レポート」>「保存」をクリックして、レポートを有効化します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/attachments/2327027/20save.png?version=1&modificationDate=1409167134311&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 28. Set the Name of your report to レポートの名前をAppend Sub Query Tutorial.に設定します。 29. Set the Description to 説明をThis report was written using the Sub Query Tutorial.に設定します。 30. Select Tutorial as the Category. カテゴリーとして「チュートリアル」を選択します。 31. Select Training as the Sub Category. サブカテゴリーとして「トレーニング」を選択します。 32. Click Activate to finish. 「有効化」をクリックして終了します。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/thumbnails/2327027/21activate.png?version=1&modificationDate=1409167133450&cacheVersion=1&api=v2)
|
|
Section |
---|
Column |
---|
| 33. You now have an active Append Sub Query report. これで、有効化された追加サブクエリーレポートが設定されました。 |
Column |
---|
| ![](https://yellowfinjp.atlassian.net/wiki/download/attachments/2327027/22active.png?version=1&modificationDate=1409167133630&cacheVersion=1&api=v2)
|
|