COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: everlearner on 15 Jun 2012 08:38:43 AM

Title: How to use distint? any example
Post by: everlearner on 15 Jun 2012 08:38:43 AM
Hi gurus,

in my report all fields are repeating twice,
can i avoid the duplication by DISTINT? i dont aware of how to use distinct on a column.
any one explain me by an example.  thanks in adv
Title: Re: How to use distint? any example
Post by: MFGF on 15 Jun 2012 09:55:44 AM
It sounds to me like the repetition is down to inaccurate modelling in your package. Descriptive items should automatically be grouped in your report and not appear twice, unless your model is inappropriately designed. Did you build the package in Framework Manager or has someone else provided it?

Regards,

MF.
Title: Re: How to use distint? any example
Post by: cognosun on 18 Jun 2012 02:18:38 AM
1) Report Studio --> Select the 'Query' ( the query which is used for your list object ) in query explorer.

2) After selecting the query you'll see a property for that Query ( at left+down) named " Auto group and summarize"

3) That property might set to 'NO' for your reprot ( guess !)

4) Make it 'Yes'..now you should't see deplicates ( as 'Yes' applies Distinct)

In case of Query studio...the process is different to avoid duplicates.
Title: Re: How to use distint? any example
Post by: blom0344 on 18 Jun 2012 08:12:16 AM
No ,that is not entirely correct.  Yes/No influences whether aggregates are used against facts.  Any query without facts (only identifiers and attributes) gets a distinct added to the SQL expression by default..
Title: Re: How to use distint? any example
Post by: wyconian on 18 Jun 2012 10:28:51 AM
I'd suggest the first thing to do is look at the underlying data to check whether there are duplicates in the source. It may be that there is a column in the data that you are not using in the query that needs to be filtered out, or there may be an issue with the join strategy (frankly there are any number of things that could be causing duplicate records).  Just specifiying auto group/summarise would at best just be hiding the issue.

Good luck :-)