Page History
...
Table of Contents | ||
---|---|---|
|
...
はじめに
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.
Master Query
The Master Query is going to include:
このチュートリアルでは、結合サブクエリーの設定を段階的に説明します。結合は、同じまたは異なるビューやソースから、複数のフィールドを1つのカラム(列)に組み合わせる必要がある場合に使用するものと考えるとよいでしょう。
このシナリオのメインレポートでは、地域別の請求額の一覧を設定します。次に、結合クエリーを使用して同じカラム(列)内にある負のコスト数値を表示した後、小計を追加して地域ごとの合計収入を確認します。
マスタークエリー
マスタークエリーには以下の項目を含めます:
- Camp Region
- 計算フィールド: "Invoiced" テキストラベル
- Camp Region
- Calculated Field: "Invoiced" text label
- Sum Invoiced Amount
Union Query
結合クエリー
結合クエリーには以下の項目を含めます:The Union Query will include:
- Camp Region
- Calculated Field: 計算フィールド:"Cost" text label
- Calculated Field: Sum Cost * -1 (to convert the Cost figures to a negative value)
...
- テキストラベル
- 計算フィールド:Sum Cost × -1 (コスト数値を負の値に変換します)
初期化
Styleclass | ||
---|---|---|
| ||
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
マスタークエリー
Styleclass | ||
---|---|---|
| ||
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Label Field
ラベルフィールド
マスタークエリーを完了するには、ラベルフィールドが必要となります。このフィールドは、マスタークエリーのロウ(行)を"Invoiced"ロウ(行)として識別するために使用されます。結合クエリーで同様の計算が行われ、"Cost"としてロウ(行)が識別されます。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".
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
結合クエリー
Styleclass | ||
---|---|---|
| ||
...
結合の作成
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Calculations
To complete the union query, two calculations will be required;
計算
結合クエリーを完了するには、2つの計算が必要となります:
- Label:結合クエリーのロウ(行)を"Cost"ロウ(行)として識別するために使用されます。マスタークエリーで同様の計算が行われ、"Invoiced"としてロウ(行)が識別されます。
- Cost:コスト数値を負の値に変換するために使用されます。つまり、小計がレポートに追加されると、コスト金額が請求金額から差し引かれます。
- 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.
Label
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Cost
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
結合の設定
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
設定の編集
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
書式
Styleclass | ||
---|---|---|
| ||
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
保存
Styleclass | ||
---|---|---|
| ||
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
horizontalrule |
---|
Styleclass | ||
---|---|---|
| ||