COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: nugget on 17 Feb 2009 08:16:42 AM

Title: Howto display only the first row of a list??
Post by: nugget on 17 Feb 2009 08:16:42 AM
Hi gurus,

i try to show only the first row of a list but it dosn't work.
i defined a variable (bool) with this content:

RowNumber()>1

then i marked the hole list an add the variable to the list.

can somebody explain me why it not works?

THX
Title: Re: Howto display only the first row of a list??
Post by: Rajaggopal on 17 Feb 2009 10:45:05 PM
i dont clearly understand what u have done but i tried something similar to what u said and it worked for me. This is what i did...

1. Create boolean variable with RowNumber() > 1
2. Select List Columns Body Style and then add this boolean variable as the Style variable.
3. For "Yes" value of the variable set the "Box Type" for List Columns Body Style to None

Another method i used to get this to work:
1. Create two data items - Data item1, Row Number
2. Data item1: have the expression as 1
3. Row Number: have the expression as running-total(Data item1)
4. The aggregate functions of both these data items should be None
5. Add a filter to the query as Row Number = 1
Title: Re: Howto display only the first row of a list??
Post by: vij on 26 Feb 2009 07:31:14 AM
If you have cognos 8.3
then in that in Report Studio there is an object called as Singleton .
The singleton object retrieves only the first row value for that query


hope it will help u ....
vij
:)
Title: Re: Howto display only the first row of a list??
Post by: nugget on 26 Feb 2009 08:41:36 AM
thanks for your reply,

but iam using cognos 8.2
Title: Re: Howto display only the first row of a list??
Post by: bwingate on 26 Feb 2009 09:08:00 AM
In the Query that you have hooked up to the list box you should be able to set the max rows retrieved set it to 1.  This might do what you need.
Title: Re: Howto display only the first row of a list??
Post by: nugget on 27 Feb 2009 01:49:03 AM
sounds good. ;D

i will test it.

Manchmal sieht man den Wald vor lauter Bäumen nicht
Title: Re: Howto display only the first row of a list??
Post by: nugget on 27 Feb 2009 03:42:12 AM
okay now i testet it and it works perfect.

thx
Title: Re: Howto display only the first row of a list??
Post by: pattr on 17 Jun 2009 07:00:41 AM
Quote from: bwingate on 26 Feb 2009 09:08:00 AM
In the Query that you have hooked up to the list box you should be able to set the max rows retrieved set it to 1.  This might do what you need.

hi my database is returning more number of rows(say 700 rows) but i want to limit to only 5 rows
Title: Re: Howto display only the first row of a list??
Post by: nugget on 23 Jun 2009 03:13:09 AM
read the post from bwingate

in your case set it to 5
Title: Re: Howto display only the first row of a list??
Post by: kristielee on 05 Aug 2009 04:15:56 PM
What if you only want to display the LAST row in a list report?  I'm using 8.3 and have the average daily balances for each day of the month, but only need the final average.  I don't want to actually display the average daily balance for each day in the month, just the final day.
Sorry to be confusing...
PS...I tried using a singleton, but as stated above, it gives me the first row...
Title: Re: Howto display only the first row of a list??
Post by: RomanP on 06 Aug 2009 04:07:23 PM
Quote from: kristielee on 05 Aug 2009 04:15:56 PM
What if you only want to display the LAST row in a list report?  I'm using 8.3 and have the average daily balances for each day of the month, but only need the final average.  I don't want to actually display the average daily balance for each day in the month, just the final day.
Sorry to be confusing...
PS...I tried using a singleton, but as stated above, it gives me the first row...

Sort your query descending, this way your last row will become your first row...