COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Sarayucog on 19 Jul 2011 02:07:28 AM

Title: Finding top 10 records after join the queries
Post by: Sarayucog on 19 Jul 2011 02:07:28 AM
I have query1 and query2. In query I am finding current days data and in query2 I am finding previous days data. I want to show these two measures in the same list report. So I am joining into one query. I want to get top 10 records also.

Here my problem is if run these queries individually those are running fine and giving top 10 records. When Iam joining these queries into one query I am not getting top 10 records and not the correct data also.

What is the reason. Please tell me...

Your help will be more appriciated. Thanks in advance
Title: Re: Finding top 10 records after join the queries
Post by: Arsenal on 19 Jul 2011 11:12:06 AM
is the ranking supposed to be on current day or previous day?
i mean, are you trying to author an overall ranked report? If your ranking on on just one of the measures then  why don't you try unranked queries for query 1 and 2 (just like you would when building unranked reports), join these two to form query3, bring in the dataitems you need into query3 and then rank this query 3 (something like rank([your measure value] for report) to get an overall top 10?
Title: Re: Finding top 10 records after join the queries
Post by: Sarayucog on 20 Jul 2011 07:57:12 AM
Thanks for you response...

but this is not working. With this process also I am getting same result.

please share any other ideas....   anybody....
Title: Re: Finding top 10 records after join the queries
Post by: Lynn on 20 Jul 2011 09:06:38 AM
It isn't clear to me how you are putting the queries together and what is wrong with your results. How are they joined? What does the data look like in Q1, Q2 separately and what do you see in the joined Q3?

Elaborating a little more beyond "not the correct data" and providing some sample data might help you get better suggestions.