Beruflich Dokumente
Kultur Dokumente
Framework Manager
is a metadata modelling tool. It is used to create project. Project is stored in file system with extension .cpf ----------------------Model is set of related query subject and query items required in one or more reporting application Query subject in cognos refers to Tables and Query items to columns Emp is querysubject empno i query item Namespace Namespace: Namespace is used to uniquely identify query subject and query item. we can import different database into separate namespace to avoid duplicate names. Query subject- table Query Item - column shortcuts shortcut are of two types Alias shortcut: is a logical copy to an alternative table name Reference shortcut: is a logical pointer to an alternative table name folders Folders are used to organized query subject based on subject sales related objects in sales folder, finanace related object in finance folder packages package : is subject of query subjects and query items defined in a project. packages are published to report authors, query users and analysis users. report author uses published packages in report studio to create complex reports, query users uses published packages in Query studio to create adhoc(instant) reports and analysis users uses published package in analysis studio to organize and explore dimensional sources note: package is stored in content store
Shekhar
Select Conn_Sample26, Next Expand Scott> Expand Tables> Check Emp and Dept Next Generate Relationship ---------------------Deselect generate criteria Import and Finish Project Viewer -----------Proj_Sample26 Conn_Sample26 DEPT EMP RGHT CLICK ON Conn_Sample26> Create > Namespace Name: Database View Drag EMP and DEPT inside Database View Namespace RGHT CLICK ON Conn_Sample26> Create > Namespace Name: Business View copy emp and dept from database view and paste shortcut in business view (select required querysubject> rght click > edit> copy select required namespace>rghtclick > edit> paste shortcut) Rename Shortcuts Rght Click on the Workspace, Create > Relationship Name: R1 Query Subject .. Browse DEPT Query Subject .. Browse EMP Link Deptno from DEPT to Deptno From EMP ok RGHT CLICK ON Conn_Sample26> Create > Namespace Name: Presentation View Rght click on Presentation View> Create> Query Subject << Name: EMPLOYEE SELECT model(Query Subject), ok From Available Items, Expand Database View Drag EMPNO,ENAME,JOB, SAL, DEPTNO,DNAME,LOC OK Project Viewer --------------Packages << Rght Click > Create > Package Name: Pkg_Employee26 next Hide Database View Hide Business View Allow Presentaion View Next Function Sets Include Oracle Functionset Finish Publish Package Wizard ? Yes
Shekhar
Next click oN 'Add' button , Click on Cognos Namespace Select Authors =>, Next Publish , Finish File(menu)> Save ======================================= Open Cognos URL Create a professonal Report<< Select Package Pkg_Employee26 create a new report << Select List, Ok From Insertable Objects(Source tab), drag EMPNO, ENAME, JOB,SAL,DNAME,LOC INSIDE LIST fILE(menu)> Save Name: Sample26 Run(menu)> Run HTML File> Save Note: To refelect Changes made in Database table with respect to values(Insert,update, delete) we have to set 'use local cache' property for a report level query to 'No' by Default it is 'Yes' To set, goto View(menu)> Queries Select the Query, goto properties --------use local cache No Save and run the report
Shekhar
import grants> no import table content> yes import entire export content > yes > exit
Shekhar
Name: headcount2,ok Count(if([ ].[ ].[sal]>1000) then (1) else (null)) Validate and ok Save and run
Condition in data item List report --------------View> queries From the toolbox, drag sql beside query1 Properties ----------DATASOURCE SELECT Conn_Sample26 sql ...<< select * from fir validate and ok dblclick Query1 from the toolbox, drag dataitem inside dataitems f(x) tab> summaries> drag count dataitems tab, drag firno inside count count([SQL].[FIRNO]) VALIDATE AND OK PROPERTIES NAME:TOTAL_FIR from the toolbox, drag dataitem inside dataitems f(x) tab> summaries> drag count dataitems tab, drag firno inside count COUNT(IF([SQL].[INSDATE]=[SQL].[UPDDATE]) THEN (1) ELSE (NULL)) VALIDATE AND OK PROPERTIES ----NAME:ONLINE_FIR from the toolbox, drag dataitem inside dataitems FROM DATAITEMS TAB, DRAG [TOTAL_FIR]-[ONLINE_FIR] VALIDATE AND OK PROPERTIES ----------NAME OFFLINE_FIR VIEW> REPORT PAGES DBLCLICK PAGE1 FROM DATAITEMS TAB, INSERT DISTRICT, TOTAL_FIR, ONLINE_FIR, OFFLINE_FIR SAVE AND RUN
Filters
The Vice President of Sales has requested a report that shows sales performance by representatives in each country for 1998. He would also like to see the performance for representatives in Asia in order to present an award to the top seller when he visits next month. Region,country,fullname,amountsold
Shekhar
Filter year region Sort amount_sold in descending order Sol4b --------List Insert region, country, fullname, amount_sold Group region+country, total- amount_sold select amount_sold, data(menu)- sort descending Data(menu) filters Detail filter tab Add [Conn_Dwh02].[CUSTDIM].[REGION]='Asia' AND [Conn_Dwh02].[SALES].[SALE_DATE] BETWEEN 1998-01-01 AND 1998-12-31 OR [Conn_Dwh02].[CUSTDIM].[REGION]='Asia' AND to_char ([Conn_Dwh02].[SALES].[SALE_DATE],'YYYY')=1998 OK,OK, SAVE AND RUN
Parameters
We have been asked to provide a report showing product sales by order date to determine the revenue generated by each individual order . Because the report contains detailed information we want to be able to filter the report to only show orders made after a specified date. Parameter: asks user to provide values at runtime Syntax ?parametername? when parameter is associated against date field then date picker is displayed to select date when parameter is associated against string field then list of string values from database is displayed to select Values when parameter is associated against number field then user has to enter values to filter data Sol5. List insert Sales query subject inside List data(menu)> Filters> add detail filter [ ].[ ].[ SALEDATE] > ?XYZ? OK,OK SAVE AND RUN
Shekhar
Valueprompt
Management has asked us to create a report that shows Quantity and Amount for each product in order to identify products. Because we produce so many products, we will add a prompt to the report page. This way users can change the product data displayed, without having to close and run the report each time. Value Prompt: is used to display database column values or user defined values. and allows to filter data based on values selected sol6a) List Insert Emp query subject from the toolbox, drag valueprompt beside list(leftside) name: Parameter1 next packageitem select job from emp query subject operator in next Finish Select valueprompt on the page, goto properties -----------autosubmit yes save and run sol6b) List Insert EMP query Subject From the toolbox, drag value prompt beside list Name: Parameter1, Finish view> queries from the toolbox,drag query on the workspace dblclick query2 from source darg hiredate inside dataitems dblclick hiredate EDIT.. TO_CHAR([ ].[ ].[HIREDATE],'YYYY') VALIDATE AND OK VIEW> QUERIES DBLCLICK QUERY1 FROM THE TOOLBOX, DRAG FILTER INSIDE DETAIL FILTERS TO_CHAR([ ].[ ].[HIREDATE],'YYYY')=?Parameter1? ok properties usage select optional view(menu)> report pages dblclick Page1 select value prompt on the page, goto
Shekhar
properties -----------query query2 use value HIREDATE auto submit Yes save and run ---------------------sol6c) List Insert emp query subject from the toolbox, drag value prompt on the page name: Parameter1 next Package Item select Deptno from Emp operator = check make the filter optional next Value to Display .. select Dname from dept Finish Select valueprompt, goto Properties --------Autosubmit Yes save and Run
Shekhar
From the toolbox, Drag Prompt Button on the page select Prompt button, goto Properties ---------Type Select Finish Save and run
Cascade Prompts
Cascade prompts: allows to select values based on value selected in another prompt List Insert Catname, Subcatname,Prodname,Listprice,MinPrice Select catname+subcatname+prodname(ctrl)> tools(menu)> Build Promptpage Select Valueprompt1, goto Properties Multiselect NO autosubmit Yes Select Valueprompt2, goto Properties Multiselect NO autosubmit Yes Cascade Source Select CATNAME Select Valueprompt3, goto Properties Multiselect Yes autosubmit No Cascade Source Select SUBCATNAME save and run
Conditional Format
A manager has requested a report that compares revenue across all product for all sales Regions. She would like to be able to quickly identify revenue greater than $1,000,000 and less than $25,000 in order to identify high and low revenue-generating product Category. We will format the revenue to appear in green text if it is considered high, and in red text if it is considered low. Conditional format --------------------is used to Change styles based on condition. variables- variable represents a value that can be changed report studio- three types of variables 1. Report language variable : variable return language name, use this to run report in different languages based on user selection
Shekhar
2. String Variable: variable returns string/ text values 3. Boolean Variable - variable returns yes or no, use boolean variable when expression or condition returns yes or no 9a) string variable Crosstab Drag region into row, catname into columns, measure into Amount_sold view(menu)> variables drag string variable into variables Expression if([Query1].[AMOUNT_SOLD]>1000000) then ('H') else if([Query1].[AMOUNT_SOLD]<25000) then ('L') validate and ok add two values H and L View> report pages> dblclick page1 select crosstab intersection, goto Properties Style Variable select String1, ok Pause mouse pointer on condition explorer, click H Properties foreground color Green Pause mouse pointer on condition explorer, click L Properties foreground color Red dblclick on green bar, save and run
9b Boolean variable
Crosstab Drag region into row, catname into columns, measure into Amount_sold view(menu)> variables drag Boolean variable into variables f(x) tab> report functions> drag column number and row number ColumnNumber ()=RowNumber () validate and ok View> report pages> dblclick page1 select crosstab intersection, goto Properties Style Variable select Boolean1, ok Pause mouse pointer on condition explorer, click Yes Properties foreground color Yellow dblclick on green bar save and run 9C) List Insert Emp query subject inside List From the toolbox, drag Query calculation inside List NAME: chk, ok
Shekhar
mod(running-count([ENAME]),2) VALIDATE AND OK View> report pages> dblclick page1 select List column body, goto Properties ^ select List column body style from ancestor Style Variable select Boolean1, ok Pause mouse pointer on condition explorer, click Yes Properties foreground color Green dblclick on green bar Select Chk Column body and Column Title, goto properties Box Type Select None Save and Run
Conditional layout
Shekhar
Conditional layout: use conditional layout to change page layout based on user selection Task: display ename,job,sal,dno when report is run in HTML format and display ename,job,hiredate, mgr,sal when report is run in PDF format Report Function : ReportOutput() Return report format like HTML,PDF, CSV etc ----------BlankView> variables drag string variable inside variables from f(x)> report functions> drag ReportOutput validate and ok Add two values HTML and PDF File>conditional layout << select String1 , ok Pause pointer on Page explorer, Click Page1 inside HTML From the toolbox, drag List insert ename,job,sal,dno Pause pointer on Page explorer, Click Page1 inside PDF From the toolbox, drag List insert ename,job,hiredate, mgr,sal save and run
Conditional Block
Blank report -------------View(menu)> prompt pages From the toolbox, drag page inside prompt pages From the toolbox, drag value prompt inside prompt page Name: paremeter1, finish Select valueprompt, goto Properties -----------Static choices .. Add Use display L sales by region C sales by category X category vs region sales Ok View> variables Drag string variable inside variable From the parameter tab, drag parameter1 and edit Paramvalue('parameter1'), ok Add three values l, c and x
Shekhar
View> report pages > dblclcik page1 From the toolobox ,drag conditional block on the page Select conditional block, goto Properties -------Block variable string1 Current block select l From the toolbox, drag list inside conditional block Insert region and amount_sold Properties Current block select c From the toolbox, drag chart inside conditional block Insert catname and amount_sold Properties Current block select x From the toolbox, drag crosstab inside conditional block Insert region,catname and amount_sold Save and run
Render Variable
------------use render variable to render/show objects based on user selection -------------blank report from the toolbox, drag list on the page insertemp query subject from the toolbox, drag query calculation inside list name: C1, ok running-count([ENAME]), Validate and ok view> report pages From the toolbox, drag page inside report pages from the toolbox, drag list on the page insertemp query subject from the toolbox, drag query calculation inside list name: C2, ok running-count([ENAME]), Validate and ok view> Prompt pages from the toolbox, drag page inside prompt pages from the toolbox, drag value prompt on the page name:Parameter1, next package item .. select ENAME operator in next, Finish view> variables drag boolean variable inside variables
Shekhar
[QUERY1].[C1]=1 OK drag boolean variable inside variables [QUERY2].[C2]=1 OK View(menu)> Report pages> dblclick Page1 select pagebody, goto properties ^ select page ancestor Render Variable select Boolean1 Query query1 View(menu)> Report pages> dblclick Page2 select pagebody, goto properties ^ select page ancestor Render Variable select Boolean2 Query query2 View(menu)> queries Dblclick on Query1, Drag deptno inside detial filter [DEPTNO]=10 View(menu)> queries Dblclick on Query1, Drag deptno inside detial filter [DEPTNO]<>10 VIEW> REPORT PAGES> DBLCLICK PAGE1 save and run pdf ===================== tASK2: List Insert EName,job,Hiredate,Mgr,Sal View> Prompt pages Drag page inside prompt pages, Dblclick Promptpage1 Drag value prompt on the pad Name: Parameter1, Finish Select Prompt, goto Properties Static choices ... USe Display c1 EName c2 Job ok Required No Multiselect Yes Select UI Radio Button group View> variables > drag boolean variable ParamValue('Parameter1') contains ('c1') ok drag boolean variable ParamValue('Parameter1') contains ('c2') ok View> report pages > dblclick page1 select ename column, goto properties
Shekhar
select List column ancestor Render variable Select Boolean1, ok select job column, goto properties select List column ancestor Render variable Select Boolean2, ok save and run PDF
Pagebreak
-------------use pagebreak to display each value of query item on new page list Insert Region, Catname, Amount_sold Group Region, Total- Amount_sold Select Region, Structure- Select Set pagebreak save and run Note: To remove pagebreak view(menu)> report pages drag page1 outside Region pageset -
Shekhar
Layout Component Reference:
use layout component refernce to reuse individual object or set of objects in the same report or another report Note: Objects must be named to reuse Properties overrides to edit components embed to set as reference (default) or copy Blank Report From the toolbox, Drag Block on the page select Block, Goto Properties Name; Block1 From the toolbox, Drag Image inside block Select image, goto properties ----------url browse image name Image1 From the toolbox, drag textitem inside block Sample text Goes here, ok Select text, goto properties ---------name: text1 From source tab, Drag Emp query Subject On the report page File> Save Name:LCR File> New> blank From the toolbox, Drag Layout Component Reference on the page Select Block1, ok From source tab, Drag dept Query subject on the page Save and Run
Shekhar
Blank Report View> Queries drag query on the workspcae dblclick query1, insert customerid, fullname, gender, city, country View> report pages> dblclick page1 select pagebody, goto Properties ^ select page query query1 from the toolbox, drag table on the page 2columns,4 rows) ================ view> prompt pages> drag page inside prompt pages,dblclick promptpage from the toolbox, drag table 1column,2 rows drag textitem inside 1st row, Enter CustomerNumber drag Textbox prompt inside 2nd row name: Parameter1, Next package item select CustomerId, Finish view> report pages> dblclick page from the toolbox, drag value prompt, Finish select Valueprompt, Goto Properties ----------------static choice ... add use display L Last 10 Transactions Q Transactiosn between dates ok AutoSubmit Yes View> variables> Drag String Variable inside variable ParamValue('Parameter2') ***** ok Add values L and Q View> Report pages> Dblclick Page1 from the toolbox, Drag Conditional Block on the page select conditional block, goto Properties Block Variable String1 Current Block L from the toolbox, Drag List inside conditional block insert sales query subject inside list view> queries> dblclick query2 *** drag filter from toolbox inside detail filters rank([SALEDATE])<=10 OK VIEW>REPORT PAGES> DBLCICK PAGE1 select list column body inside conditional block, data(menu)> master detail relationship <<*** click on New Link Link Customerid and Custid SAVE AND RUN
Shekhar
Shekhar
Select Amount_Sold, Sort> Descending Data> filters [ ].[ ].[CALENDAR_YEAR]=1999 AND [ ].[ ].[AMOUNT_SOLD] >100000 SELECT AFTER AUTO AGGREGATION, OK,OK rght click on fullname column body> Drill Through Definitions add drill through Target Report tab report ... Select Contact_Det Action Run the report Format HTML check open in New window click on edit- parameters NAME TYPE REQUIRED METHOD VALUE ID NUMBER YES Pass Dataitem Value Custid ok ok Save and run
11b)Bookmark Blank Report from the toolbox, drag bookmark on the page select bookmark, goto properties -----------source type text label Main from the toolbox, drag list on the page insert Country view> report pages from the toolbox, drag page inside report pages dblclick page2 Drag list, insert country, prodname, amount_sold group country, Total Amount_sold select country, structure>set pagebreak structure> lock page objects < click to unlock from the toolbox, bookmark beside country column body(leftside) select bookmark, goto properties -----------source type select data item value structure>lock page objects << structure> headers and footers>page header and footer check page footer
Shekhar
from the toolbox, drag text item inside page footer, goto Main Page, ok Rght click on the above text, drill through definitions bookmark tab source type Select Text text Main ok View> report pages > dblclick page1 rght click on country column body> drill through definitions bookmark tab type select data item values dataitem values select Country ok,ok
Report Bursting
--------------Report Bursting is a process in which report is run once and result is distributed to user by breaking content based on group column Report bursting is used when set of users require same report format with specific content Blank view> Queries drag query on the workspace dblclick query1, insert Customerid, fullname,catname,amountsold, city(email column) view> report pages> dblclick page1 Drag List on the workspace- change query for list to Query1 from dataitems tab, Insert Fullname, Catname,amount_sold Group Fullname, Total > Amount_sold file(menu)> burst options check make report available for bursting query query1 query query1 label fullname dataitem city group edit - drag customerid type email address inside group folder ok file> Save NAme: Burst_Rep ---------Cognos connection Pkg_Sales > Burst_rep > run with options, select save the report, click on advanced options> check burst the report run check view the details ok refersh report output -- click on yes
Shekhar
Shekhar
Shekhar