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

...

Table of Contents
classcontents

...

はじめに

Styleclass
ClasstopLink

top

Master Query

The Master Query is going to include:

Union Query

The Union Query will include:

...

ページトップ

このチュートリアルでは、結合サブクエリーの設定を段階的に説明します。結合は、同じまたは異なるビューやソースから、複数のフィールドを1つのカラム(列)に組み合わせる必要がある場合に使用するものと考えるとよいでしょう。

このシナリオのメインレポートでは、地域別の請求額の一覧を設定します。次に、結合クエリーを使用して同じカラム(列)内にある負のコスト数値を表示した後、小計を追加して地域ごとの合計収入を確認します。

マスタークエリー

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

  1. Camp Region
  2. 計算フィールド: "Invoiced" テキストラベル
  3. Sum Invoiced Amount

結合クエリー

結合クエリーには以下の項目を含めます:

  1. Camp Region
  2. 計算フィールド:"Cost" テキストラベル
  3. 計算フィールド:Sum Cost × -1 (コスト数値を負の値に変換します)

初期化

Styleclass
ClasstopLink

topページトップ

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

topページトップ

Section
Column
width30%

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

Column
width70%

Image Added

ラベルフィールド

マスタークエリーを完了するには、ラベルフィールドが必要となります。このフィールドは、マスタークエリーのロウ(行)を"Invoiced"ロウ(行)として識別するために使用されます。結合クエリーで同様の計算が行われ、"Cost"としてロウ(行)が識別されます。

Section
Column
width30%

5. ビューフィールド一覧パネルの下部で「+」をクリックし、計算フィールドを作成します。

Column
width70%

Image Added

Section
Column
width30%

6.計算フィールド名」をLabelに設定します。
注意:このフィールドの名前は任意です。名前が変更されても結合の処理方法は変更されません

7. ここで示すように、メイン計算パネルでテキストボックスにInvoicedと入力し、「+追加」をクリックして計算式に追加します。

Column
width70%

Image Added

Section
Column
width30%

8.テスト」ボタンをクリックして、計算式が正しく作成されたことを確認します。

9.保存」ボタンをクリックして、計算式を完了します。

Column
width70%

Image Added

Section
Column
width30%

10.カラム(列)」または「表のプレビュー」のどちらかで、計算フィールドの「Label」を、「Camp Region」と「Sum Invoiced Amount」のフィールドの間にドラッグします。

Column
width70%

Image RemovedImage Added

...

結合クエリー

Styleclass
ClasstopLink

topページトップ

...

結合の作成

Section
Column
width30%

611. 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 Union and Style to Basic.

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

12. 「タイプ」を「結合」に、「スタイル」を「基本」に設定します。

13.OK」をクリックしてクエリーを設定します。

Column
width70%

Image Added

計算

結合クエリーを完了するには、2つの計算が必要となります:

  1. Label:結合クエリーのロウ(行)を"Cost"ロウ(行)として識別するために使用されます。マスタークエリーで同様の計算が行われ、"Invoiced"としてロウ(行)が識別されます。
  2. Cost:コスト数値を負の値に変換するために使用されます。つまり、小計がレポートに追加されると、コスト金額が請求金額から差し引かれます。

Label

Section
Column
width30%

14. ビューフィールド一覧パネルの下部で「+」をクリックし、計算フィールドを作成します。

Column
width70%

Image Added

Section
Column
width30%

15.計算フィールド名」をLabelに設定します。
注意:このフィールドの名前は任意です。名前が変更されても結合の処理方法は変更されません。

16. ここで示すように、メイン計算パネルでテキストボックスにCostと入力し、「+追加」をクリックして計算式に追加します。

17.テスト」ボタンをクリックして、計算式が正しく作成されたことを確認します。

18.保存」ボタンをクリックして、計算式を完了します。8. Click Ok to set up the query.

Column
width70%

Image RemovedImage Added

...

Cost

Section
Column
width30%

19. ビューフィールド一覧パネルの下部で「+」をクリックし、計算フィールドを作成します。

20.計算フィールド名」をCostに設定します。
注意:このフィールドの名前は任意です。名前が変更されても結合の処理方法は変更されません。

21. 」ボタンをクリックします。

22.フィールドを選択」ドロップダウンから「Camp Cost」フィールドを選択し、「+追加」をクリックします。

23.) 」をクリックしてカッコを閉じます。

24. 値でフィールドを乗算するには、「 * 」ボタンをクリックします。

25. テキスト入力フィールドに-1と入力して、「+追加」をクリックして計算式に追加します。

26.テスト」ボタンをクリックして、計算式が正しく作成されたことを確認します。

27.保存」ボタンをクリックして、計算式を完了します。

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%

Image RemovedImage Added

...

結合の設定

Section
Column
width30%

28.マスタークエリーフィールド」の「Camp Region」の横の「サブクエリーフィールド」に、「Camp Region」をドラッグします。

29.マスタークエリーフィールド」の「Label」の横の「サブクエリーフィールド」に、計算フィールドの「Label」をドラッグします。

30.マスタークエリーフィールド」の「Sum Invoiced Amount」の横の「サブクエリーフィールド」に、計算フィールドの「Cost」をドラッグします。

31. サブクエリーの名前をCostに変更して、「保存」をクリックして結合を完了します。

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.

Column
width70%

Image RemovedImage Added

...

設定の編集

Section
Column
width30%

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

Column
width70%

...

書式

Styleclass
ClasstopLink

topページトップ

Section
Column
width30%

23. Click on the first 33.Sum Invoiced Amount field's drop down list and select Format. 」フィールドのドロップダウンリストをクリックして、「集約の合計」を適用します。

Column
width70%

Image RemovedImage Added

Section
Column
width30%

34.Camp Region」フィールドのドロップダウンリストをクリックして、「書式」を選択します。メインナビゲーションバーから、「カラム(列)の書式」メニューを選択することもできます。

35.重複表示の排除」オプションを有効化します。これにより、最終的な表に小計が組み込まれて、表がより読みやすくなります。

Column
width70%

Image Added

Section
Column
width30%

36.Camp Region」フィールドが表示されているときに、「サマリー」設定を開いて「小計」オプションを有効化します。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.

Column
width70%

Image RemovedImage Added

Section
Column
width30%

37.カラム(列)の書式」メニューが表示されているときに、左側の一覧から「Sum Invoiced Amount」フィールドを選択します。

36. 名前をValueに設定します。

Column
width70%

Image Added

Section
Column
width30%

38. メニューを閉じます。

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%

Image RemovedImage Added

...

保存

Styleclass
ClasstopLink

topページトップ

Section
Column
width30%

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

Column
width70%

Image RemovedImage Added

Section
Column
width30%

28. Set the Name of your report to Append 40. レポートの名前Union Sub Query Tutorial.に設定します。

29. Set the Description to 41. 説明This report was written using the Sub Query Tutorial.に設定します。

3042. Select Tutorial as the Category.

31. Select Training as the Sub Category.

カテゴリーは「Tutorial」を選択します。

43. サブカテゴリーは「Training」を選択します。

44.有効化」をクリックして終了します。32. Click Activate to finish.

Column
width70%

Image RemovedImage Added

Section
Column
width30%

33. You now have an active Append Sub Query report.45. これで、結合サブクエリーレポートが作成できました。

Column
width70%

Image RemovedImage Added



horizontalrule
Styleclass
ClasstopLink

topページトップ