Thursday, December 31, 2009

DataSource Connection

DataSouce can be defined at 2 places.

a) Cognos Connection
b) Framework Manager

It actually has 2 parts as well. Datasource which is kind of physical connection to the database and second is the datasouce connection which contains the credentials to conenct to the database.

If you see any datasource at the cognos connection,you can actually click on it and you will find the datasource connection(s) under it.You may have multiple datasouce connection for a datasource. When user will run report, he will be prompted to select which datasource connection he wants to use for report.Signon is kind of reusable thing,while defining datasouce connection,you can say that make it signon as well, if you do that then any other person can also use that signon and create many more datasources.He would just need to copy and paste singon from one place to other place(under the new datasource). This work perfactly when you have single ID/PSWD for multiple databases, you won't need that administrator( person knowing ID/PSWD) to enter ID/PSWD for you again and again for each databases.


At Framework manager you can not just right click the Data sources Folder and create a new datasources.You will need to run MetaSata Wizard to get to that place from where either you can bring a existing datasource into your model or create a new datasouce.You just click on namespace and then goto to ACTION menu and click MetaData Wizard. From here procedure is same as you create a datasource from Cognos Connection.

To be continued.......

Degenerated,Confirmed and Junk Dimension

Degenerated Dimensions- In simple terms this is actualy is not a dimension because in dimension modelling we do not have a separate dimension for this. Its bit confusing right? Let us understand it in more detail - We have seen in lof of examples of degenerate dimension on web where we get example of Invoice number,Line number in a bill. We will take one most simple example. We have a fact table where in we store the results of students, I also need rank of students in the fact table and I do not want rank to appear as 1,2,3 but I want rank to appear as FIRST ,SECOND ,THIRD. Now here one thing you can do is to add 1 column that will store values like 1,2,3 and create a dimension rank dimension and store following values there

Rank Rank Descr
-----------------
1 First
2 Second
3 Third

Now you can connect that fact table with Rank Dimension ( just think this example objectively, because there are lot of ways to handle this at report level) to get the Rank Descr.

But if you see we can avoid this join if we can directly put FIRST ,SECOND,THIRD values in fact itself becuase we don't have anything thing stored in rank dimension. So this way a dimension will be killed and will become a part of a fact table. So this particular FIRST,SECOND,THIRD part will be called DEGENERATED DEMENSION in the fact table.

Confirmed Dimesnion - We have seen lot of definitions of Conformed dimensions, here we will see what is it through Cognos eye. Whenever we create a model using framework manager,it is not necessary that one star schema would satisfy your needs, we might need more then one star schema groupings ( I will have separate blog on what is star schema grouping).Different star schemas uses different fact tables but they might use some dimensions which are common across different different star schemas. These common dimensions are called Conformed Dimensions, typically you can say Time Dimension is a conformed dimension.In a product related information model Product dimension may work like a confoemed dimension.

Junk Dimension - While doing modelling there are lot of things which do not classify as facts, so should we make dimensions out of them ? If we start doing this we will end up making lot of small small dimensions and will crowd our modeliing space.So we have to decide whether making separate dimension makes sense for something.Suppose there are 5 things we are not going to make separate dimension for, we will put all these details into one dimensions and call that dimension a junk dimension.Mainly junk dimesnion contains flags like how customer came to purchase something buy car or bike, he is living in rented home or having his own home,customer placed order via web,phone or by any other means etc. Now you can see by these details that theses kind of details do not deserve to have there own dimension.

Bookmarks in Cognos


You can see here four columns have been added to the list , one column variable descr have been converted into a section. Unlock report and click Variable descr column and go to its properties
>Drill Through Definitions > Bookmark Tab
change SourceType value to 'DataItem Value' , Click OK.
Add a book mark just adjscant to variable descr and go to bookmarks properties.
Change source Type property to 'DataItem Value' and DataItemValue property to Varialbe Descr.
Now when you run this report this bookmark will have value of Variable descr value.
Suppose one of the value of Variable descr is 'India' , so now put a text item at the top of the report and go to its drill throug definition and go to bookmark tab and set sourcetype='text' and text=India, now you can run the report and get the output in pdf. In pdf when you click on that text item , it will directly take you to the palce where variable descr is having its value equal to India.