Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{anchor:top}
{toc: class=contents}

h2. Overview概要
{styleclass: Class=topLink}[topページトップ|#top]
{styleclass}
Calculated fields allow you to create basic calculations with the fields available in your report.  
計算フィールドを使用して、フィールドに対する基本的な計算を行うことができます。
{color:#C00000#c00000}{*Note:}注意:*{color} a calculated field that you create in the report builder cannot be used across multiple reports.  It is unique to your report only.  If you create a set of calculated fields you wish to use across multiple reports you can either:
# Request the calculations to be included in the View by your administrator or
# Copy the report containing the calculations using the copy function - the copied report will contain the new calculated fields as well.

h3. Why Use Calculated Fields?
When an administrator designs a View they may not create all the variables that you are likely to need in the course of your report writing.  The intention of a view is to provide you with sufficient fields for you to be able to write the report you need and to use some of these fields as the basis for more complex calculations.


h2. Simple Formulaレポートビルダーで作成した計算フィールドは、複数のレポートで共有することはできません。そのレポートに固有のものです。複数のレポートで共有する一連の計算フィールドを作成する場合は、以下のいずれかを実行することができます:
# 管理者に要請してビューに対して計算フィールドを定義してもらう。
# コピー機能を使って計算フィールドを含むテンプレートレポートをコピーし、これをひな形として別のレポートを作成する。

h3. なぜ計算フィールドを使うのか?

ビューを設計する際、管理者がユーザーによるレポート作成に必要と思われるすべての変数を用意してくれるとは限りません。ビューの目的はユーザーがレポートを作成するのに充分で、かつそれらに基づいてより複雑な集計を行うことができるだけのフィールドを提供することです。


h2. シンプル式
{styleclass: Class=topLink}[topページトップ|#top]
{styleclass}
Simple Formulas allow you to build calculations using the formula builder button interface. These may range from very simple addition or multiplication through to CASE statements.
シンプル式を使用すると、式ビルダーインターフェースのボタンを使用して、計算式を作成することができます。これらは非常にシンプルな加算または乗算からCaseステートメントまで、多岐にわたる場合があります。
{expand:title=Click to view instructions...クリックして説明を表示します。}
# Click the *+* button at the bottom of the field list in the Data step of the report builder.レポートビルダーの「データ」ステップで、フィールド一覧の下部にある「*+*」ボタンをクリックします。
!01addCalc.png|thumbnail,border=1!
# The Calculated Field window will now appear. You will need to define the following:
## Provide a name for your formula in the *Calculated Field Name* box. This will be used as the field name in your table and/or chart output.  
## Select *Simple* from the *Formula Type* drop down list. 
## Use the formula buttons and field drop down list to add components to your calculation. You cannot type directly into the calculation area of the window, each part of the formula needs to be added using buttons. Yellowfin will not permit you to select combinations of variables that are incompatible - therefore options that are greyed out will become active as you add in elements.
{color:#CC0000}*Note:*{color} if you wish to type your calculation you may need to use the [Freehand SQL|Calculations#Freehand SQL] option discussed later.
「計算フィールド」ウインドウが表示されます。以下のことを定義する必要があります:
## 「*計算フィールド名*」ボックスで、式の名前を指定します。この名前は、表やグラフの表示でフィールド名として使用されます。
## 「*式のタイプ*」ドロップダウンリストから、「*シンプル*」を選択します。.
## 式のボタンやフィールドドロップダウンリストを使用して、計算式に要素を追加します。ウインドウの計算領域に直接入力することはできず、ボタンを使用して、式のそれぞれの部分を追加する必要があります。Yellowfinは式として成り立たない変数や演算子の組み合わせを許しません。そのため、その局面で選択できない要素を以下の図のようにグレイ(灰色)で表示します。
{color:#cc0000}{*}注意:*{color}計算式を入力する場合は、後述する「 [フリーハンドSQL|計算#Freehand SQL] 」オプションの使用が必要なことがあります。
!02buildCalc.png|thumbnail,border=1!
# Once finished click the *Validate* button to ensure your calculation is not missing any components. 終了したら、「*テスト*」ボタンをクリックして、計算式に欠落している要素がないことを確認します。
!03validateCalc.png|thumbnail,border=1!
# Click *Save* to complete your calculation.  It will now be available in a folder called calculated fields at the bottom of the field list in the Data step.  保存*」をクリックして計算式を完成します。「データ」ステップのフィールド一覧の下部にある計算フィールドと呼ばれるフォルダーに、計算式が表示されるようになります。
!04useCalc.png|thumbnail,border=1!
{expand}


h2. Pre-Defined Formula定義された式
{styleclass: Class=topLink}[topページトップ|#top]
{styleclass}
Using a pre-defined formula you can add calculation to your report that will be based on formula rules defined by an administrator or are system default.  
定義された式を使用して、式のルールが管理者によって定義されたものかシステムデフォルトかに関係なく、レポートに式のルールに基づいて計算式を追加することができます。
{expand:title=Click to view instructions...クリックして説明を表示します。}
# Click the *+* button at the bottom of the field list in the Data step of the report builder.レポートビルダーの「データ」ステップで、フィールド一覧の下部にある「+」ボタンをクリックします。
!01addCalc.png|thumbnail,border=1!
# The Calculated Field window will now appear. You will need to define the following:
## Provide a name for your formula in the *Calculated Field Name* box. This will be used as the field name in your table and/or chart output.  
## Select *Pre-Defined* from the *Formula Type* drop down list. 
## Choose the formula you wish to apply - the selection is specific to the type of database that your data is sourced from.「計算フィールド」ウインドウが表示されます。以下のことを定義する必要があります:
## 「*計算フィールド名*」ボックスで、式の名前を指定します。この名前は、表やグラフの表示でフィールド名として使用されます。
## 「式のタイプ」ドロップダウンリストから、「*定義済み*」を選択します。
## 適用する式を選択します(データの供給元であるデータベースのタイプによって、選択は異なります)。
!05selectFn.png|thumbnail,border=1!
## You will now be provided with options to complete your calculation. Click on each parameter to define it.  
計算式を完成させるためのオプションが表示されます。各パラメーターをクリックして定義します。
!06defineParam.png|thumbnail,border=1!
## Provide a value using one of the options provided. These will vary depending on the type of value required.表示されているオプションのいずれかを使用して値を指定します。表示されるオプションは、必要な値のタイプによって異なります。
!07defineValue.png|thumbnail,border=1!
# Click *Save* to complete your calculation. 
保存*」をクリックして計算式を完成します。
!08saveFn.png|thumbnail,border=1!

# Your calculation will now be available in a folder called calculated fields at the bottom of the field list in the Data step.  
# 「データ」ステップのフィールド一覧の下部にある計算フィールドと呼ばれるフォルダーに、計算式が表示されるようになります。
!09useFn.png|thumbnail,border=1!
{expand}


h2. Freehand SQLフリーハンドSQL
{styleclass: Class=topLink}[topページトップ|#top]
{styleclass}
If you have SQL skills you may wish to write your SQL directly into the SQL edit box. In this case select the 'Enter SQL' option from the formula tab. This will open the SQL edit box.
Insert the SQL you wish to create your column.
SQLに関するスキルがあれば、SQLエディター(フリーハンドSQL)を使用して直接SQLステートメントを記述することができます。「式」タブを選択してください。SQLエディター(フリーハンドSQL)が開きます。
登録するSQLをフィールドに記述してください。
{expand:title=Click to view instructions...クリックして説明を表示します。}
# Click the *+* button at the bottom of the field list in the Data step of the report builder.レポートビルダーの「データ」ステップで、フィールド一覧の下部にある「*+*」ボタンをクリックします。
!01addCalc.png|thumbnail,border=1!
# The Calculated Field window will now appear. You will need to define the following:
## Provide a name for your formula in the *Calculated Field Name* box. This will be used as the field name in your table and/or chart output.  
## Select *Freehand SQL* from the *Formula Type* drop down list. 
## Enter the SQL use wish to use to populate the field.
{color:#CC0000}*Note:*{color} The Freehand SQL builder will require:
### An SQL SELECT fragment, not including the SELECT keyword or any FROM or WHERE clauses
### Columns referenced to exist in the view
### No aggregate functions (AVG, MIN, MAX, SUM, and COUNT) should be used.「計算フィールド」ウインドウが表示されます。以下のことを定義する必要があります:
## 「*計算フィールド名*」ボックスで、式の名前を指定します。この名前は、表やグラフの表示でフィールド名として使用されます。
## 「*式のタイプ*」ドロップダウンリストから、「*フリーハンドSQL*」を選択します。
## フィールドにデータを投入するために使用するSQLを入力します。
{color:#cc0000}{*}注意:*{color}フリーハンドSQLビルダーの要件は以下のとおりです:
### SELECT命令の中身を記述します。SELECTキーワード、FROM節、またはWHERE節は使用できません。
### 参照するカラムがビュー内に存在していること。
### 集計関数(AVG、MIN、MAX、SUM、およびCOUNT)は使用不可。
!10freehand.png|thumbnail,border=1!
# Once finished click the *Validate* button to ensure your calculation is not missing any components. 終了したら、「*テスト*」ボタンをクリックして、計算式に欠落している要素がないことを確認します。
!11freehandValidated.png|thumbnail,border=1!
# Click *Save* to complete your calculation.  It will now be available in a folder called calculated fields at the bottom of the field list in the Data step.  
保存*」をクリックして計算式を完成します。「データ」ステップのフィールド一覧の下部にある計算フィールドと呼ばれるフォルダーに、計算式が表示されるようになります。
!12useFreehand.png|thumbnail,border=1!
{expand}


h2. Edit a Calculated Field計算フィールドの編集
{styleclass: Class=topLink}[topページトップ|#top]
{styleclass}
To edit a calculated field:
# Hover over the calculation in the Field List of the Data step and click on the drop down menu to open it
計算フィールドを編集するには、以下の手順を実行します:
# 「データ」ステップのフィールド一覧の計算式にマウスカーソルを重ね、ドロップダウンメニューをクリックして開きます。
!03calcDropDown.png|thumbnail,border=1!
# Select the *Edit Calculation* option「*計算式を編集*」オプションを選択します。
!03calcEdit.png|thumbnail,border=1!


h2. Delete a Calculated Field計算フィールドの削除
{styleclass: Class=topLink}[topページトップ|#top]
{styleclass}
To delete a calculated field:
# Hover over the calculation in the Field List of the Data step and click on the drop down menu to open it計算フィールドを削除するには、以下の手順を実行します:
# 「データ」ステップのフィールド一覧の計算式にマウスカーソルを重ね、ドロップダウンメニューをクリックして開きます。
!03calcDropDown.png|thumbnail,border=1!
# Select the *Delete* option「*削除*」オプションを選択します。
!03calcDelete.png|thumbnail,border=1!

\\
\\
{horizontalrule}
{styleclass: Class=topLink}[topページトップ|#top]
{styleclass}