Wiki Markup |
---|
{anchor:top} {toc: class=contents} h2. Introductionはじめに {styleclass: Class=topLink}[topページトップ|#top] {styleclass} In this tutorial, we will walk through setting up a *Union* sub query. A good way to think about *Unions* is - use them if you need to combine multiple fields into the one column, either from the same or different views or sources. In this scenario our main report will have a list of invoicing figures by region, we will then use the Union query to display negative cost figures in the same column, and then add sub totals to see the total income for each region. h3. Master Query The Master Query is going to include: このチュートリアルでは、*結合サブクエリー{*}の設定を段階的に説明します。*結合{*}は、同じまたは異なるビューやソースから、複数のフィールドを1つのカラム(列)に組み合わせる必要がある場合に使用するものと考えるとよいでしょう。 このシナリオのメインレポートでは、地域別の請求額の一覧を設定します。次に、結合クエリーを使用して同じカラム(列)内にある負のコスト数値を表示した後、小計を追加して地域ごとの合計収入を確認します。 h3. マスタークエリー マスタークエリーには以下の項目を含めます: # Camp Region # Calculated Field:計算フィールド: "Invoiced" textテキストラベル label # Sum Invoiced Amount h3. Union結合クエリー Query The Union Query will include: 結合クエリーには以下の項目を含めます: # Camp Region # Calculated Field: 計算フィールド:"Cost" textテキストラベル label # Calculated Field: Sum 計算フィールド:Sum Cost *× \-1 (to convert the Cost figures to a negative value) (コスト数値を負の値に変換します) h2. Initialise初期化 {styleclass: Class=topLink}[topページトップ|#top] {styleclass} {section} {column: width=30%} *1.* Click on the *Create* link and select *Report* to begin building your report. 「*作成*」リンクをクリックして、「*レポート*」を選択しレポートの作成を開始します。 {column} {column: width=70%} !01create.png! {column} {section} {section} {column: width=30%} *2.* You should now be on the Initialise Report page. Select the *Drag and Drop Builder* as the build tool.「レポートの初期化」ページが表示されます。作成ツールとして「*ドラッグ&ドロップで作成*」を選択します。 {column} {column: width=70%} !02builderType.png! {column} {section} {section} {column: width=30%} *3.* Select ビューとして「*Ski Team*」を選択します。 as the View. {column} {column: width=70%} !03view.png|thumbnail,border=1! {column} {section} h2. Master Queryマスタークエリー {styleclass: Class=topLink}[topページトップ|#top] {styleclass} {section} {column: width=30%} *4.* Drag and drop the 「 !rpt_dim.png! *Camp Region* dimension and」ディメンションおよび「 !rpt_metric.png! *Invoiced Amount* metric into the *Columns* list. 」メトリックを「*カラム(列)*」にドラッグ&ドロップします。 {column} {column: width=70%} !04masterFields.png|thumbnail,border=1! {column} {section} h3. Labelラベルフィールド Field To complete the master query, a label field is required. This will be used to identify the rows from the master query as "Invoiced" rows. There will be a similar calculation in the union query to identify rows as "Cost". マスタークエリーを完了するには、ラベルフィールドが必要となります。このフィールドは、マスタークエリーのロウ(行)を"Invoiced"ロウ(行)として識別するために使用されます。結合クエリーで同様の計算が行われ、"Cost"としてロウ(行)が識別されます。 {section} {column: width=30%} *5.* Click on the *+* to create a calculated field, in the bottom of the View Fields List panel. ビューフィールド一覧パネルの下部で「+」をクリックし、計算フィールドを作成します。 {column} {column: width=70%} !05addCalc.png! {column} {section} {section} {column: width=30%} *6.* Set the *Calculated Field Name* to *Label* 「*計算フィールド名*」を{*}Label{*}に設定します。 {color:#CC0000#cc0000}{*Note:}注意:*{color} the name for this field can be anything, it will not change the way the union works if it's called something else. このフィールドの名前は任意です。名前が変更されても結合の処理方法は変更されません *7.* Type ここで示すように、メイン計算パネルでテキストボックスに{*}Invoiced* into the text box under the main calculation panel, as shown here, and click *+ Add* to add it to the calculation. {*}と入力し、「*\+追加*」をクリックして計算式に追加します。 {column} {column: width=70%} !06typeLabel.png|thumbnail,border=1! {column} {section} {section} {column: width=30%} *8.* Click the *Validate* button to ensure your calculation is built correctly. 「*テスト*」ボタンをクリックして、計算式が正しく作成されたことを確認します。 *9.* Click the *Save* button to complete your calculation. 「*保存*」ボタンをクリックして、計算式を完了します。 {column} {column: width=70%} !07saveLabel.png|thumbnail,border=1! {column} {section} {section} {column: width=30%} *10.* Drag the 「*カラム(列)*」または「*表のプレビュー*」のどちらかで、計算フィールドの「*Label* calculation to between the 」を、「*Camp Region* and 」と「*Sum Invoiced Amount* fields in either the *Columns* list or *Table Preview*.」のフィールドの間にドラッグします。 {column} {column: width=70%} !08addLabel.png|thumbnail,border=1! {column} {section} h2. Union結合クエリー Query {styleclass: Class=topLink}[topページトップ|#top] {styleclass} h3. Create Union結合の作成 {section} {column: width=30%} *11.* Click on the 「データ」ステップの左側にある「サブクエリー」パネルで「*+* button in the Sub Query panel to the left of the Data step to add a Sub Query. 」ボタンをクリックし、サブクエリーを追加します。 *12.* Set the Type to *Union* and Style to *Basic*.「タイプ」を「*結合*」に、「スタイル」を「*基本*」に設定します。 *13.* Click 「*OkOK* to set up the query. 」をクリックしてクエリーを設定します。 {column} {column: width=70%} !09addUnion.png|thumbnail,border=1! {column} {section} h3. Calculations計算 To complete the union query, two calculations will be required; # Label: this will be used to identify the rows from the union query as "Cost" rows. There will be a similar calculation in the master query to identify rows as "Invoiced". # Cost: this will be used to convert the cost figure to a negative value. This will mean that when a sub total is added to the report, the cost amount will be subtracted from the invoiced amount. 結合クエリーを完了するには、2つの計算が必要となります: # Label:結合クエリーのロウ(行)を"Cost"ロウ(行)として識別するために使用されます。マスタークエリーで同様の計算が行われ、"Invoiced"としてロウ(行)が識別されます。 # Cost:コスト数値を負の値に変換するために使用されます。つまり、小計がレポートに追加されると、コスト金額が請求金額から差し引かれます。 h4. Label {section} {column: width=30%} *14.* Click on the *+* to create a calculated field, in the bottom of the View Fields List panel. ビューフィールド一覧パネルの下部で「+」をクリックし、計算フィールドを作成します。 {column} {column: width=70%} !05addCalc.png! {column} {section} {section} {column: width=30%} *15.* Set the *Calculated Field Name* to *Label* 「*計算フィールド名*」を{*}Label{*}に設定します。 {color:#CC0000#cc0000}{*Note:}注意:*{color} the name for this field can be anything, it will not change the way the union works if it's called something else. このフィールドの名前は任意です。名前が変更されても結合の処理方法は変更されません。 *16.* Type ここで示すように、メイン計算パネルでテキストボックスに{*}Cost* into the text box under the main calculation panel, as shown here, and click *+ Add* to add it to the calculation. {*}と入力し、「*\+追加*」をクリックして計算式に追加します。 *17.* Click the *Validate* button to ensure your calculation is built correctly. 「*テスト*」ボタンをクリックして、計算式が正しく作成されたことを確認します。 *18.* Click the *Save* button to complete your calculation. 「*保存*」ボタンをクリックして、計算式を完了します。 {column} {column: width=70%} !10labelCost.png|thumbnail,border=1! {column} {section} h4. Cost {section} {column: width=30%} *19.* Click on the *+* to create a calculated field, in the bottom of the View Fields List panel. ビューフィールド一覧パネルの下部で「+」をクリックし、計算フィールドを作成します。 *20.* Set the *Calculated Field Name* to *Cost* 「*計算フィールド名*」を{*}Cost{*}に設定します。 {color:#CC0000#cc0000}{*Note:}注意:*{color} theこのフィールドの名前は任意です。名前が変更されても結合の処理方法は変更されません。 name for this field can be anything, it will not change the way the union works if it's called something else. *21.* Click on the「 *∑* button.」ボタンをクリックします。 *22.* Select the 「*フィールドを選択*」ドロップダウンから「*Camp Cost* field from the *Select Field* drop down, and click *+ Add*.」フィールドを選択し、「*\+追加*」をクリックします。 *23.* Close the bracket by clicking 「 *)*. 」をクリックしてカッコを閉じます。 *24.* Click the値でフィールドを乗算するには、「 *\** button to multiply the field by a value. 」ボタンをクリックします。 *25.* Type *テキスト入力フィールドに-1* into the text entry field, and click *+ Add* to put in your calculation.1と入力して、「*\+追加*」をクリックして計算式に追加します。 *26.* Click the *Validate* button to ensure your calculation is built correctly. 「*テスト*」ボタンをクリックして、計算式が正しく作成されたことを確認します。 *27.* Click the *Save* button to complete your calculation. 「*保存*」ボタンをクリックして、計算式を完了します。 {column} {column: width=70%} !11costCalc.png|thumbnail,border=1! {column} {section} h3. Configure Union結合の設定 {section} {column: width=30%} *28.* Drag the 「*マスタークエリーフィールド*」の「*Camp Region* field into the *Sub Query Fields* list, directly next to the 」の横の「*サブクエリーフィールド*」に、「*Camp Region*」をドラッグします。 field in the *Master Query Fields* list. *29.* Drag the *Label* calculated field into the *Sub Query Fields* list, directly next to the *Label* field in the *Master Query Fields* list. *29.* 「*マスタークエリーフィールド*」の「*Label*」の横の「*サブクエリーフィールド*」に、計算フィールドの「*Label*」をドラッグします。 *30.* Drag the *Cost* calculated field into the *Sub Query Fields* list, directly next to the 「*マスタークエリーフィールド*」の「*Sum Invoiced Amount* field in the *Master Query Fields* list.」の横の「*サブクエリーフィールド*」に、計算フィールドの「*Cost*」をドラッグします。 *31.* Change the name of the Sub Query to *Cost* and click *Save* to complete the *Union*.サブクエリーの名前を{*}Cost{*}に変更して、「*保存*」をクリックして{*}結合{*}を完了します。 {column} {column: width=70%} !12configureUnion.png|thumbnail,border=1! {column} {section} h3. Edit Settings設定の編集 {section} {column: width=30%} *32.* If you need to make changes to your sub query setup at all, click the *Edit Settings* link. 全体的にクエリー設定を変更する必要がある場合は、「*設定の編集*」リンクをクリックします。 {column} {column: width=70%} !10settings.png! {column} {section} h2. Formatting書式 {styleclass: Class=topLink}[topページトップ|#top] {styleclass} {section} {column: width=30%} *33.* Click on the *Sun「*Sum Invoiced Amount* field's drop down list and apply a *Sum Total*」フィールドのドロップダウンリストをクリックして、「*集約の合計*」を適用します。 {column} {column: width=70%} !13sumTotal.png! {column} {section} {section} {column: width=30%} *34.* Click on the 「*Camp Region* field's drop down list and select *Format*. You could also select the *Column Formatting* menu from the main navigation bar. 」フィールドのドロップダウンリストをクリックして、「*書式*」を選択します。メインナビゲーションバーから、「*カラム(列)の書式*」メニューを選択することもできます。 *35.* Enable the *Suppress Duplicates* option. This will make the final table easier to read, with the inclusion of sub totals. 「*重複表示の排除*」オプションを有効化します。これにより、最終的な表に小計が組み込まれて、表がより読みやすくなります。 {column} {column: width=70%} !14suppress.png|thumbnail,border=1! {column} {section} {section} {column: width=30%} *36.* While still on the 「*Camp Region* field, open the *Summary* settings and enable the *Sub Total* option.」フィールドが表示されているときに、「*サマリー*」設定を開いて「*小計*」オプションを有効化します。 {column} {column: width=70%} !14subTotal.png|thumbnail,border=1! {column} {section} {section} {column: width=30%} *37.* While still in the *Column Formatting* menu, select the 「*カラム(列)の書式*」メニューが表示されているときに、左側の一覧から「*Sum Invoiced Amount*」フィールドを選択します。 field from the list on the left. *36.* Set the name to *Value*.名前を{*}Value{*}に設定します。 {column} {column: width=70%} !15title.png|thumbnail,border=1! {column} {section} {section} {column: width=30%} *38.* Close the menu. メニューを閉じます。 {column} {column: width=70%} !16closeFormat.png|thumbnail,border=1! {column} {section} h2. Save保存 {styleclass: Class=topLink}[topページトップ|#top] {styleclass} {section} {column: width=30%} *39.* Click 「*Reportレポート* > 」>「*Save保存* to activate your report. 」をクリックして、レポートを有効化します。 {column} {column: width=70%} !17save.png! {column} {section} {section} {column: width=30%} *40.* Set the *Name* of your report to *レポートの{*}名前{*}を{*}Union Sub Query Tutorial{*.}に設定します。 *41.* Set the *Description* to *説明{*}を{*}This report was written using the Sub Query Tutorial{*.}に設定します。 *42.* Select カテゴリーは「*Tutorial* as the *Category*.」を選択します。 *43.* Select サブカテゴリーは「*Training* as」を選択します。 the *Sub Category*. *44.* Click 「*Activate有効化* to」をクリックして終了します。 finish. {column} {column: width=70%} !18activate.png|thumbnail,border=1! {column} {section} {section} {column: width=30%} *45.* You now have an active Union Sub Query report. これで、結合サブクエリーレポートが作成できました。 {column} {column: width=70%} !18union.png! {column} {section} \\ \\ {horizontalrule} {styleclass: Class=topLink}[topページトップ|#top] {styleclass} |
Page Comparison
General
Content
Integrations