Wednesday, 21 March 2012

Tuple and Complete Tuple explained with examples

Hi Guys ,

Usually the simplest thing that most of cognos developers know is Tuple will give you a exact cell in a crross tab .Like we have Year as rows ,product line as column and revenue as measure

So by tuple we can get tuple ([Revenue],[2004],[Camping Equipment])

So while working with crosstab and charts in which scenarios can we use tuple is the first thing to consider.And why we decided to go tuple in those cases

IBM defination

The tuple function serves to specify the specific context that a filter, sort order or another function (such as value() or rank()) will operate against. A tuple indicates which coordinates of the cube are in use for the operation being executed.



where to use Tuple

In the example we are getting the revenue for 2005 because time is showing values for 2005.So as
long as we have the dimensional value in crosstab we do not require to go for tuple.Consider we
did not have 2005 in the crosstab and we wanted to work on 2005 revenue .then we go for tuple.
One more thing to keep in mind is we are not specifying both the dimensions required for tuple
only one dimension.The other dimension it will take from current dimension.In this case the
product line.



Note Every hierarchy has a default member or default measure in case of measures.The default member in case of [great_outdoors_company].[Years].[Years] is YEAR which means it will have all the years data consider the year hierarchy has 4 years 2004,2005,2006,2007 then Year means all the members .So in case of complete tuple when we say default member in case of year it will be all years.


Few Useful notes

when we go for set ?

In a crosstab we need to show months as columns say Jan ,Feb march .We just drag the month from teh model and it has jan,feb march as members so it workds fine.

Suppose you want to define a new column which has Year 2004,Quarter1 2004,Jan,Feb,March you put all of these members into one set .So you now have one new column which has all the members that you want and without set you would have to put these members manually as columns .

Why For clause not used much in Dimensional reporting

Hi Guys,

Earlier i used to work mostly with dimensional reporting and so did not use For clause often.However wheni started to work on relational reporting i noticed that here for clause is used quite often.

So what is the reason for this.Why we do not use for clause much in dimensional reporting.

When working with dimensional model we do not use for much .What is the reason for this .If you use ( FOR clause) sometimes you might get a warning op-ER -0144 .The reason is simple whenever you drag items from a level in a for clause the item should be key of the level because by default cognos will group by key of the level irrespective of what you specify in your for clause.

The error 0144 is just trying to warn you that your for will not be taken into account

Please go through below link on how to solve the error

http://cognossimplified.blogspot.in/2011/10/op-err-0144-grouping-on-property-or.html

Tuesday, 20 March 2012

Active report example

Hi Guys,

Below is the example created by me










In this example we have a pie chart.The variable for pie chart is set to be equal to year that we click on (Behavior on select).There should be interactivity between pie chart and data deck and master detail between data deck and inside combination chart

We need a data deck to keep the comb chart because this data deck will have master detail relationship between the combination chart and Year data item in data deck

Saturday, 17 March 2012

Active report ideas begin

Hi Guys,

So the question is where to start for Active reports.There is a redbook available on IBM site for Cognos 10 active reports which gives detail example of how to use each item .So download it and go through.So lets start with some interesting ideas on what we can make with Active reports

Below are Steps to create a basic active report.

It includes lot of concept of Master detail relationship and below active reports concepts

1)Data button bar
2)Data deck
3)Tab Control
4)Radio button group
5)Deck



Below are steps to create the report

1) Take 2 blocks
2) Data button bar
3) Data Deck
4) Click on interactivity and create new variable joining both of them
5) Add a tab control
6)In interactivity of tab control create a new variable Display_V
7) In Container select set Label in Display V
Behavior on select - When you have a tab control and you click on one of the tabs what you expect
it to do that is called behavior select
Container select is which tab to show from the list of tabs that we have

8) Add a repective items in the named tabs Like Bar,Pie and List
9) Add year data item to Pie query and create master detail relationship between data deck and
this tab control and this year
Note - You will have a interaction between data button and data deck First.Then you are going to have a master detail relationship between this data deck and tab control

10) In the list tab add 2 more blocks
11) Add a radio button group
12) Add a deck
13) Join the radio button group and deck based on label
14) add product and revenu and a rank calculation
15) Create a master detail relationship between top button adn list
16)creat deck for top 5 and top 10
17)create master detail relationship between both the decks top 10 and top 5
18)Note if you put something as deck it wont generate a query .When you put data deck it will
generated a query and you can have master detail relationship between only those which are called
deck

Saturday, 10 March 2012

ORA- 12541 TNS listener issue

Hi

this is the most frequent issue that i encounter whenever i start cognos on my pc.So below is the steps to resolve it

1)TNS Listener should start before any other service like oracle database.
2)When oracle database comes up the listener listens to it and attaches .So listener should be on first

If you are not able to start listener from the services.The go to oracle in start up menu and click on configuration and migration and click on net configuration assistant.and configure your listener

If you want to check if the listener is working ping ORCL or the TNSname in you tnsnames.ora file this will make sure that your Ip address given in the tnsnames files is correct.

Recently my ip add got changed and the tnsname file had the old address

Go to command prompt and type ipconfig to get your ip address

One of the things you can do to check if the listener is listening to your tnsnames is type in

tnsping orcl

where orcl is your tnsname

Below is a post which tells about tnsping ,Ping how they can be used to solve your database connection problems

http://www.oracleutilities.com/OSUtil/ping.html


Belos is a very useful command to find the address of listener and its status.In My case my ip had changed and my tnsnames file still had the old ip.So when i used lsnrctl stat command i realised that the ip of the listener is different than my ip in tnsnames.

lsnrctl stat

Check below.When the listener is present on 192.168.2.4 the service name is still orcl.168.2.6 which is the old ip.so this has to be taken care in tnsnames file

Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.4)(PORT=1521)))
Services Summary...
Service "orcl.168.2.6" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.168.2.6" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT.168.2.6" has 1 instance(s).

what is the difference between 127.000.0.1 and  192.168.2.4 .Why do we write in Host  192.168.2.4 .Though your home ip is 127.000.0.1 . And why will your cognos fail to connect to database installed on your own machine if the net connection is down  ??

192.168.2.4- --- This is assigned to your by your router .Its your ip address for your local network.

Now it's important to note that this is the IP address of the computer. In fact, since I'm behind a router, this is not the IP address that will actually be used when I access the internet. The IP address shown here is my computer's IP address on my local network only.


You can also get ORA-12170 


Check your listener.ora file .Sometime the listener does not start up .the common reason can be ip of your system that is ther in the listener file is wrong .

So when you reconfigure it then the ip gets set automatically. So if you get the error check you listner.ora file and TNS name file .Both of them should have same ips.

The function ADDDATES is used for local processing but is not used as built in function or one of its parameters is not supported

Hi

If you encounter this error.First take a fresh report and check if the function is supported by cognos .That is a blank report put this function in a new query and check.99% it will be supported by cognos and you will get no errors .

So why this error in your report when you try to use this function.The reason is cognos is trying to use this query as local processing and you are using a database function and it cannot replace it with similar local function .Like in case of cast it will easily replace with a local cast function.

So you can try to remove any other local function that are being used in the report so that cognos can make most use of database functions .There is not gurantee that this function will still work after you remove all the local function and replace with cognos function.

Consider below case

If you are having this query in which you are using ADDDATE function (Mysql) and this is used as a reference query then in main query you might be using some cognos local function which are not possible to replace with cognos function like extract(month,'2011-01-01') .

So its difficult to remove this local processing error.Try to use different functions in most cases.it will solve your issue.