If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Master Detail Relationship between Crosstab and Chart

Started by buzz, 01 Jun 2010 06:10:01 AM

Previous topic - Next topic

buzz

Hi,
I wonder why I can´t create a Master Detail Relationship between a Crosstab and a chart. I have placed the crosstab in a tablecell and the Chart in a second table cell (tablecells are in the same table).
Crosstab and chart are using the same query.
Even if crosstab has one query and chart has another query, I can´t create a master detail relationship.

I get the following error message: No master query context can be found for this object.

I am a beginner of Cognos, so I hope this question is easy for you to answer.

/ buzz

CognosPaul

Master detail relationships are used when you place an object (such as a chart) inside another object (such as a list or repeater). Unfortunately crosstabs don't support embedding objects inside the nodes.

An example would be a list of years with an embedded line graph showing sales per month.

You would create a list that looks like:

+------+
| Year |
+------+
| 2008 |
| 2009 |
| 2010 |
+------+


Drag a line chart object into the list, like you would drag in a field from the table.

Your list should now look like:


+------+----------+
| Year |   Graph  |
+------+----------+
| 2008 | ┌──────┐ |
| 2009 | │      │ |
| 2010 | └──────┘ |
+------+----------+

(that little box in the chart, just play along, it's hard drawing those things)

Put months in the categories, sales in the measure and years in the series.

Now because the chart is inside the list you can set up the master/detail. Set the join on Year --> Year (put the year field into the query related to the chart if it's not already there). That's it. When you run the report every row will show the year in the left column, and the sales by month for that year.

The crucial thing to remember is that that example works because it was embedded inside an object. By placing the graph inside a table Cognos assumed that it should look for a query attached to the page. Failing to find that it returned that error.

Now the question then becomes what are you trying to accomplish?

nagababu

thanks for your answer.
but i need one clarification on your answer with taking inside but how could i do with out taking inside?
is it possible?

CognosPaul

Master detail relationships work only when one object is in the context of another object. A chart inside a repeater inside a list inside a pageset.

If you put a chart on a page there wouldn't be any context for it. The concept of a master detail only makes sense when you consider what it's doing.

In my previous example I created a list of years. In that example the chart would run for each row, generating the data for the year on that row. If the chart wasn't inside that list it wouldn't have any context, it wouldn't know on which year to filter. Therefore it would return data for all of the years.

dmk.3678

Quote from: CognosPaul on 01 Jun 2010 06:36:15 AM
Master detail relationships are used when you place an object (such as a chart) inside another object (such as a list or repeater). Unfortunately crosstabs don't support embedding objects inside the nodes.

An example would be a list of years with an embedded line graph showing sales per month.

You would create a list that looks like:

+------+
| Year |
+------+
| 2008 |
| 2009 |
| 2010 |
+------+


Drag a line chart object into the list, like you would drag in a field from the table.

Your list should now look like:


+------+----------+
| Year |   Graph  |
+------+----------+
| 2008 | ┌──────┐ |
| 2009 | │      │ |
| 2010 | └──────┘ |
+------+----------+

(that little box in the chart, just play along, it's hard drawing those things)

Put months in the categories, sales in the measure and years in the series.

Now because the chart is inside the list you can set up the master/detail. Set the join on Year --> Year (put the year field into the query related to the chart if it's not already there). That's it. When you run the report every row will show the year in the left column, and the sales by month for that year.

The crucial thing to remember is that that example works because it was embedded inside an object. By placing the graph inside a table Cognos assumed that it should look for a query attached to the page. Failing to find that it returned that error.

Now the question then becomes what are you trying to accomplish?

So Paul,

In you above example. I want to place the graph outside the context, in column list, and in second column graph. But the thing i am trying to achieve is that, now when i click on the Year lets say Year=2008, so as soon as i click on 2008, the graph should dynamically plot it self for the year 2008. Can this be achievable by any method. This can be done in OBIEE, but i am not sure how can we do this in cognos.