COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cschnu on 09 Nov 2009 02:47:59 PM

Title: Rownumber()
Post by: cschnu on 09 Nov 2009 02:47:59 PM
I am attempting to find the function in Cognos that lets me specify the rownumber over a given column. So the sql generated should look like the following


select row_number() over (PARTITION BY Field order by Field)
from table


What function can i use in Cognos to generate this SQL?
Title: Re: Rownumber()
Post by: Sreeni P on 10 Nov 2009 12:06:31 PM
If the column is distinct , then go for "running-count"
Ex:running-count(cityname)
Title: Re: Rownumber()
Post by: cschnu on 12 Nov 2009 08:55:12 AM
Quote from: srinivas_p on 10 Nov 2009 12:06:31 PM
If the column is distinct , then go for "running-count"
Ex:running-count(cityname)
Yes, this gives me what i needed. I also used the for clause so

running-count([table].[cityname] for [table].[state])
Title: Re: Rownumber()
Post by: alik on 03 Nov 2020 03:24:37 AM
select row_number() over (PARTITION BY Field order by Field)
from table

cognos:
running-count(rank(orderByField for PartitionField) for PartitionField)