COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Eugene on 11 Nov 2019 10:00:46 AM

Title: select distinct col1, col2, col3
Post by: Eugene on 11 Nov 2019 10:00:46 AM
I have the following sql statement :

select distinct col1, col2, col3 from tableName

I would like to make a list which shows the distinct combination of the above columns.

Can you suggest me how to do it.

I tried sth like this distinct col1 for col2 without any success.

Thanks in advance.
Title: Re: select distinct col1, col2, col3
Post by: Andrei I on 11 Nov 2019 10:45:36 AM
Are you using this SQL statement as a Query foundation in the Report Studio?
Did you try to create this report straight from a Package?
By default for non measure attributes Cognos Engine will generate  a SQL like this:

select col1, col2, col3 from tableName
group by  col1, col2, col3
Title: Re: select distinct col1, col2, col3
Post by: Eugene on 12 Nov 2019 02:36:14 AM
No, I do not want to use it through an SQL object.

Also I do not want to create it through a package.

My source of the report is a package but  I want to simulate the query statement
in a list through data items and query-calculations.

Is this possible  in any way  ?
Title: Re: select distinct col1, col2, col3
Post by: Andrei I on 12 Nov 2019 07:53:02 AM
Do not use distinct.
Are you using relational package?
Are all these fields dimensional attributes without any aggregation?