30日間の無料評価版をお試しいただけます。

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Anchor
top
top

Table of Contents
classcontents

...

概要

Styleclass
ClasstopLink

...

top

ページトップ

Wiki Markup
{html}<iframe width="700" height="394" src="https://www.youtube.com/embed/CyUgmM4PmBI?color=white" frameborder="0" allowfullscreen></iframe>{html}
 

はじめに

Styleclass
ClasstopLink

ページトップ

このチュートリアルでは、2年分の数値を比較するために追加サブクエリーを設定する処理を、段階的に説明します。

 

追加は、レポートのその他の部分とは異なるフィルターを必要とするカラム(列)をレポートに追加する場合に使用するものと考えるとよいでしょう。

このシナリオのメインレポートでは、2014年における国別の請求額を表示します。追加するカラム(列)は、2013年の請求額です。フィルターYear = 2014Year = 2013が競合するため、追加を使用して別のカラム(列)を加える必要があります。

マスタークエリー

マスタークエリーには以下の項目を含めます。

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:

  1. Athlete Country
  2. Sum Invoiced Amount
  3. 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」のために追加クエリーを使用します。

追加クエリー

追加クエリーには以下の項目を含めます。

  1. 結合:Athlete Join: Athlete Country
  2. Sum Invoiced Amount
  3. 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」フィールドのコピーがクエリーに組み込まれます。

初期化

Styleclass
ClasstopLink

...

ページトップ

Section
Column
width30%

1. Click on the Create link and select Report to begin building your report. 作成」リンクをクリックして、「レポート」を選択しレポートの作成を開始します。

Column
width70%

Section
Column
width30%

2. You should now be on the Initialise Report page. Select the Drag and Drop Builder as the build tool. 「新規レポート作成」ページが表示されます。作成ツールとして「ドラッグ&ドロップビルダー」を選択します。

Column
width70%

Section
Column
width30%

3. Select ビューとして「Ski Team as the View.」を選択します。

Column
width70%

...

マスタークエリー

Styleclass
ClasstopLink

...

ページトップ

Section
Column
width30%

4. Drag and drop the Image Removed Athelte Country dimension and Image Added Athlete Country」ディメンションおよび「 Invoiced Amount metric into the Columns list. 」メトリックを「カラム(列)」一覧にドラッグ&ドロップします。

5. Drag and drop the Year dimension into the Filters list.」ディメンションを「フィルター」一覧にドラッグ&ドロップします。

Column
width70%

...

追加クエリー

Styleclass
ClasstopLink

...

ページトップ

...

追加の作成

Section
Column
width30%

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.

「データ」ステップの左側にある「サブクエリー」パネルで「+」ボタンをクリックし、サブクエリーを追加します。

7. 「タイプ」を「追加」に、「スタイル」を「基本」に設定します。

8. OK」をクリックしてクエリーを設定します。8. Click Ok to set up the query.

Column
width70%

...

追加の結合

Section
Column
width30%

サブクエリーを設定する際に最初に定義する必要があるのは、結合タイプと結合フィールドです。

9. 結合タイプを「左外部結合」に設定します。

10. マスタークエリーフィールド」ドロップダウンリストで、「Athlete Country」フィールドを選択します。このフィールドにサブクエリーを結合します。

11. 「Athlete Country」フィールドを*「サブクエリーフィールド」ボックスにドラッグして、マスタークエリーに結合します。

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.

Column
width70%

...

フィルター

Section
Column
width30%

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
width70%

...

サブクエリー名と保存

Section
Column
width30%

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.サブクエリーの名前をPrevious Yearに変更します。このように変更しておくと、あとでサブクエリーを識別する場合(特に、複数のサブクエリーが存在する場合)に役立ちます。

14. サブクエリーを保存します。14. Save the Sub Query.

Column
width70%

...

カラム(列)の追加

Section
Column
width30%

15. Drag and drop the Invoiced Amount metric into the Columns list. 」メトリックを「カラム(列)」一覧にドラッグ&ドロップします。

Column
width70%

...

設定の編集

Section
Column
width30%

16. If you need to make changes to your sub query setup at all, click the Edit Settings link. クエリー設定を変更する必要がある場合は、「設定の編集」リンクをクリックします。

Column
width70%

...

フィルターの適用

Section
Column
width30%

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
width70%

Section
Column
width30%

18. Click on the Settings link in the Filters panel. This will allow you to configure logic and values for all filters. フィルター」パネルで「設定」リンクをクリックします。これにより、すべてのフィルターについてのロジックおよび値を設定することができます。

Column
width70%

...

マスターフィルター

Section
Column
width30%

19. Set the Master Query filter to be Year Equal to 2014 by clicking on the funnel icon. マスタークエリー」フィルターを「Year 等しい(=)2014」となるように設定します。

Column
width70%

Section
Column
width30%

20. Select 2014 and click submit 2014」を選択して「送信・実行」をクリックします。

Column
width70%

...

サブクエリーフィルター

Section
Column
width30%

21. Navigate to the sub query filters by clicking on the Previous Year tab.」タブをクリックして、サブクエリーフィルターに移動します。

Column
width70%

Section
Column
width30%

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
width70%

...

書式

Styleclass
ClasstopLink

...

ページトップ

Section
Column
width30%

23. Click on the first 最初の「Sum Invoiced Amount field's drop down list and select Format. 」フィールドのドロップダウンリストをクリックして、「書式」を選択します。

Column
width70%

Section
Column
width30%

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
width70%

Section
Column
width30%

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
width70%

...

保存

Styleclass
ClasstopLink

...

ページトップ

Section
Column
width30%

27. Click Report > Save to activate your report. レポート」>「保存」をクリックして、レポートを有効化します。

Column
width70%

Section
Column
width30%

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
width70%

Section
Column
width30%

33. You now have an active Append Sub Query report. これで、有効化された追加サブクエリーレポートが設定されました。

Column
width70%

 

horizontalrule
Styleclass
ClasstopLink

ページトップ

 

...