中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册信息技术管理部8/9/2019中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第1页共27页修改记录编号日期描述版本作者审核发布日期12007-07-01初稿V1.0RTAOTeam2中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第2页共27页目录1.前言.........................................................................................................................31.1.编写目的···············································································31.2.参考文档···············································································31.3.预期读者···············································································31.4.术语定义···············································································32.POWERPLAYTRANSFORMER模型开发手册.................................................42.1.PowerPlayTransformer功能简介·················································42.2.Transformer界面简介·······························································42.3.建立模型设计的方法································································52.4.制作IQD文件········································································62.5.建立多维模型·········································································82.5.1.定义数据源连接·································································82.5.2.添加数据源·······································································92.5.3.添加MEASURE度量···························································112.5.4.建立层次维······································································112.6.模型的一些属性说明和设置······················································142.6.1.NUMERIC型COLUMN的设置················································142.6.2.ROLLUP设置····································································162.6.3.设置数值的格式································································162.6.4.添加CUBE文件·································································172.6.5.维度内容显示配置·····························································192.7.运行模型生成Cube·································································202.8.Cube的权限设置····································································212.8.1.导入角色·········································································212.8.2.权限设计·········································································232.9.Cube增量更新·······································································252.10.模型打包发布········································································25中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第3页共27页1.前言1.1.编写目的《中国建设银行CognosTransformer模型开发手册》是CognosTransformer模型设计的操作手册,包括了Transformer模型设计的基本方法和一些使用技巧,为建行CognosTransformer模型开发和设计人员提供参考和指导。1.2.参考文档《中国建设银行Cognos报表开发交付规范》Cognos的帮助文档1.3.预期读者Transformer模型设计人员Transformer模型开发人员1.4.术语定义中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第4页共27页2.PowerPlayTransformer模型开发手册2.1.PowerPlayTransformer功能简介PowerPlayTransformer(以下简称Transformer)是Cognos8中一个重要的组件,也是一个OLAP服务器,主要用来创建模型,帮助你组织数据,将不同数据源的数据整合到PowerCube当中,形成多维数据源。而根据生成好的PowerCube模型,AnalysisStudio便可在此基础上各种报表,比较数据和发现业务发展趋势。Transfomer模型能够帮助将数据从各种数据源组织进多维的PowerCube中,创建能够比较数据和发现趋势的报表。在用Transfomer建立模型之前,首先要评测数据,以及确定如何构造它们,以使它们能够支持业务分析的类型;然后用Transfomer构造创建数据的模型;最后生成一个PowerCube,让用户通过AnalysisStudio直接查看和应用其中的数据。2.2.Transformer界面简介Transformer界面包括以下四个基本窗格:数据源(DataSources)窗格数据源窗格的作用是将数据集成到模型中来。根据模型设计文档,从能够支持应用的数据仓库及数据库中确定要查询哪些数据,并将它们加载进数据源窗格。然后再将数据源窗格的数据用于建立维度图,并创建PowerCube。在数据源窗格中可以有一个或多个数据源,每个数据源来自于一个数据源文件(例如.iqd等),每个数据源都有自己的数据源名。每个数据源由构成它的若干列(Columns)组成。这是做模型的原始基本素材。数据源窗格中列的数据类型:打开列的属性(双击列名)--General标签页--Dataclass如果数据源不是来源于.iqd,则它的列的数据类型开始为Unspecified(未指定)。维度图(DimensionMap)窗格中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第5页共27页维度图窗格是一个用于建立多维立方体结构的工作区。根据数据源中的文本数据,各个维度以及每个维度下层的设定在此组织(维度和层)。最底层要对应数据源窗格中的一个列。度量(Measures)窗格度量窗格用于建立和显示模型所需要的度量。度量值是在PowerPlay报表单元中可视的数据。根据模型设计文档,定义应用中需要的度量。模型中至少要有一个度量,度量与维度的最底一层关联。每个标准度量要在数据源中对应有一个列(计算度量除外)。PowerCube窗格PowerCube窗格显示用模型创建的PowerCube。2.3.建立模型设计的方法建立模型设计时,应首先选择度量,然后选择能够支持度量的维度和层。作模型设计时,选好要说明的业务领域:1)选定能够说明业务领域关键成功因素的度量指标;2)确定能够准确地反映数据等级结构的层。为了使应用导航比较快速和易中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第6页共27页于操作,尽量保持每个维度中的层数不超过5层。3)选择的维度与度量要匹配。推荐维度数尽量保持在5~7个,因为较少的维度可以使得应用几乎更直观和易于使用。在生成PowerCube前,在Transfomer模型中必须完成:1)集成数据源数据2)建立维度图3)定义需求的度量建立模型的一般流程:2.4.制作IQD文件IQD文件用于在多维模型中组织数据源,实际的作用就是将所需要的维表和事实表从数据库中读出来,成为生成Cube的数据来源。根据以往的经验,虽然IQD文件中可以手写较为复杂的SQL语句,但如果是事实表IQD不建议这样做,IQD文件中最好只有简单的SELECT语句,这样不至于影响效率。可以通过一个IQD的模版手工编写IDQ文件:制作IQD文件建立多维模型运行模型生成CUBE模型打包发布中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第7页共27页a)第1、2行是固定语句b)第3行指明了到数据库的逻辑连接名c)第4行实际是表名d)从第5行到第8行是IQD中的查询语句主体e)从第9行到结束是对查询出来的每个字段的申明以上皆为固定格式也可通过Framework生成IQD文件,避免手写的劳动。由软件自动完成,可以避免出错的可能性:1、首先把查询对象的属性修改成iqd2、然后发布模型时把下面的选项的勾打上,并且设置好存放iqd脚本的路径如下图:中中国国建建设设银银行行CCooggnnoossTTrraannssffoorrmmeerr模模型型开开发发手手册册第8页共27页2.5.建立多维模型2.5.1.定义数据源连接使用IQD作为多维模型的数据源首先要在Cognos安装路径下的Cognos.ini文件中正确定义到数据库的连接,连接字符串可以从Cognos的Portal上获得。打开Cognos.ini文件,在文件内容后面添加逻辑数据源名称及”=”符号,然后把连接字符串拷入。中中国国建建设设银银行行CCoo