Wiki Markup |
---|
{anchor:top} {toc: class=contents} h2. Overview概要 {styleclass: Class=topLink}[topページトップ|#top] {styleclass} A仮想テーブルを利用して、派生フィールドを返すSQLステートメントをビューに挿入し、これを論理的なテーブルとしてビューで使用することが可能です。 virtual table allows you to insert an SQL statement into the view which brings back a set of derived fields and used as a logical table in the view builder. Virtual tables have the following advantages: * *Reducing the amount of data returned in a query.* You can include complex calculations and functions in a virtual table. These operations are performed before the result set is returned to a report, which saves time and reduces report complexity. * *Reducing maintenance of database summary tables.* Virtual tables can, in some cases, replace aggregate tables stored on a database. These aggregate tables are costly to maintain. Derived tables can return the same data and provide real time data analysis. h2. Create Virtual Table 仮想テーブルには、以下の利点があります: * *クエリーが返すデータの総量を減らすことができます。* 仮想テーブルに複雑な計算や関数を含めることができます。結果がレポートに戻される前にこれらが実行されることで、時間を節約しレポートの複雑さを軽減することができます。 * *データベースのメンテナンスを減らすことができます。* 仮想テーブルをデータベース上の集約テーブルの代替として使用できる場合があります。これらの集約テーブルは、メンテナンスにコストがかかります。仮想テーブルは、集約テーブルと同じデータを返すことができ、リアルタイムのデータ分析を可能にします。 h2. 仮想テーブルの作成 {styleclass: Class=topLink}[topページトップ|#top] {styleclass} # To create a new virtual table drag the virtual table icon from your table list onto the canvas. 仮想テーブルを作成するには、テーブルリストにある「仮想テーブル」アイコンをキャンバスの上にドラッグします。 !01.png! # The virtual table has an additional SQL link, click this to open the SQL popup. 仮想テーブルには、「SQL」というリンクが追加されています。クリックすると「仮想テーブル」ウインドウが開きます。 !02.png! You can update the name of the table and insert the SQL to create your derived fields. このウインドウではテーブル名称の更新と、派生フィールドを作るためのSQLを編集することができます。 !91.png! {color:#C00000#c00000}{*Note:}注意:*{color} Your SQL cannot contain order by statements as this will cause the reports to fail. For aggregate columns ensure that you define the column name (as statement). This is required by Yellowfin to generate column names. # Click the 'Validate SQL' Link to test your SQL against your target database. # Click Save to save you SQL. This will show you a list of columns returned from your SQL statement. SQLステートメントにはソート順を含むことができません。レポートの実行失敗の原因になります。SUMなど関数を適用するカラムには、ステートメントとしてカラム名を明示的に設定してください。Yellowfinではそのカラム名を使用します。 # 「SQLのテスト」をクリックしてSQLをテストします。 # 「保存」をクリックして作成したSQLを保存します。SQLが返すカラムの一覧が表示されます。 !92.png! h2. Edit Virtual Table SQL 仮想テーブルSQLの編集 {styleclass: Class=topLink}[topページトップ|#top] {styleclass} To edit the SQL of your virtual table click the edit link on the virtual table summary page. This will open the SQL editor. 仮想テーブルのSQLを編集するには、「仮想テーブル」ウインドウで「編集」をクリックしてSQLエディターを開きます。 !02.png! If you have already attached columns from your Virtual table to your view you will have to be aware of the impact that any changes you make will have. For example you may drop columns or rename ones that are already in use. その仮想テーブルのカラムが、既にビューに使用中である場合には、SQLへの変更がビューに与える影響にも留意してください。たとえば、ビューで使用中のカラムを削除したり、名前を変更したりすると、ビューからそのカラムが参照できなくなります。 \\ \\ {horizontalrule} {styleclass: Class=topLink}[topページトップ|#top] {styleclass} |
Page Comparison
General
Content
Integrations