Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

performing calculation on two query sets

Status
Not open for further replies.

mohammedhajat

Programmer
Mar 18, 2009
4
0
0
GB
Hi, I am very new to cognos and having a bit of trouble with a calculation i am trying to perform.

I have two list tables, both with their own query sets, Query 1 & Query 2.

both list tab 1 & 2 have No of orders, on it.

list tab 1 is ALL orders,
list tab 2 has all orders filtered by a certain status.

so on list tab 3, i want to show the percentage diffrenece between the No of orders on list tab 1, and list tab 3.

I tried to join query 1 & Query 2. to get Query 3 and use a calculated field to performa the calculation, but this does not show any data...

any ideas on where im going wrong?
 
Hard to say, did you check whether query 3 produces any data based on the join between between 1 and 2? (Tabular data)
In any case you still need to define dataitems associated with query 3 to work with. Is the join valid?

Ties Blom

 
no data is being produced, i have joined Query 1 and 2 to Query 3, and defined a relationship based on the description of the order, as both description are identical on both 1 & 2, so i defined a 1 to 1 relationship.

but when querying Query 3 with :

Query1.orders/query2.orders

This is where i get the error.
 
That is not possible. When performing the calculation you need dataitems associated with Query3
(they do not appear automatically) When you select query3 in the query browser then you need to drag the object into the query builder and define your calculation on these dataitems.
Anyway, join on descriptions is practice, you need to join on key fields

Ties Blom

 
Hi mohammedhajat

I was trying to do same thing since 2 days..Did you suceed?

I wanted to basically get percentage
( Totalcallsfor Query1/Total calls for Query2)*100 This is what I an trying in Query3 no luck.

Please help.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top