Can we put Distinct in webi reports

Hi ALL, :wave:
Im running a report in webi and it returns all double rows in the result so by that insted of showing 2 claim count it showing 8 because there are 4 duplicated (4*2= 8 ).
If i manually put distinct after select statement in webi SQL behind its working can i put automatically, i have one table TableA which is a summary table and any join with that table brings duplicate records.
How can i avoid this?Please let me know.
Thanks in advance,
Madhu.


madhu@P (BOB member since 2008-08-04)

hi,
i think u r missing one of the joins.
b’coz i had this kind of issue one time and i was missing one join.so check all the joins and try it again.


Biku724 (BOB member since 2008-07-29)

Hi Biku724,
Please do not use Instant Message abbreviations (u, r, b’coz) on BOB. We want to keep BOB easy to understand for our International community. Thanks.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi Thankyou so much for quick response,
Well do you want me to check the join between the summary table and the other table? Between what tables?
Here TableA which is summary table is by Date means every thing will be same except the ExpDate.
means

col1      col2  ......   ExpDate
1            A             1/1/2007
1            A             1/2/2007
1            A             1/3/2007
1            A             1/4/2007
.

.
.
.

2             B             2/1/2007
2             B             2/2/2007.

Any join with this table will be repeted these number of time.

Please let me know.


madhu@P (BOB member since 2008-08-04)

yes,check the join between teh summary table and other tables.


Biku724 (BOB member since 2008-07-29)

Hi,
Well i just checked with DBA the join between those 2 tables should be that way the Summary table is in such a way that it will record the transaction on Date basis with same set of claims so claims are repeting with different ExpDate. No other join can be possible between them. :frowning:


madhu@P (BOB member since 2008-08-04)

You may very well have a data model issue. However, you can add the distinct by opening the query properies and marking the “No Duplicate Rows” option. That will add the distinct.

Note that this doesn’t fix a data model problem, it may very well just mask it. But to answer your question, that’s how you can get the word “distinct” included in your query.


Dave Rathbun :us: (BOB member since 2002-06-06)

Hi Dave,Thank you so much.
Thats good enough,they basically want to mask DB errors thats what i observed,so this will be good enough.
Can you please tell me do we have to do this for every report how to set this by default for evry report? If they open a new report the option should be unchecked,how to do this please let me know.

Thanks,
Madhu.


madhu@P (BOB member since 2008-08-04)

Hi Good Morning,
In the report the querry option for duplicates is always checked, if i want to uncheck for every new reort to be created what i have to do ? please let me know.
:?
Thanks,
Madhu.


madhu@P (BOB member since 2008-08-04)

You can’t, and frankly that would be a bad idea anyway.

Distinct has overhead, makes your query run slower. If you require distinct on every query then you have data problems that need to be resolved. Adding a distinct doesn’t fix the problem.


Dave Rathbun :us: (BOB member since 2002-06-06)

Agreed, sort the data model out at the source, this sort of Bodging / fixing has no place in the presentation layer.

Usually, it has an eventual cost, often it causes problems not only for users, but also for maintenance - if someone, such as yourself, leaves the project.

If you reports are complex, you are going to be seeing bad performance…


Mak 1 :uk: (BOB member since 2005-01-06)

To be Frank Dave,
They dnt want to change the data in the database,we have 3 objects, DateLag1,DateLag2,DateLag3 well this will caliculate the number of days between two dates,now as dates are repeting for suppose number of days between is 4 and as per querry the rows are duplicating for 4 times the days that are returning are 4*4 = 16 which is wron,if i create a variable in the report its showing correct(that because the already existing DateLag1 field is making join 4times so its repeting).
Now they want me to fix the DateLag1,DateLag2…These date fields, so that even thoug its repeting they have to show up coorect date.They are universe objects,i dnt know what to do that .Their definition is:
DateLag1= To_Date(DateRetuned,‘YYYY/MM/DD’) - To_Date(DateReported,‘YYYY/MM/DD’).(This is declared as measure in universe)
Please help me out with this…

Thanks in advance,
Madhu.


madhu@P (BOB member since 2008-08-04)

HI ALL, :wave:
I got the solution ,i wanted to share with you all,well i did not fixed the perminent solution as they dn’t want to touch the DB, but i fixed the variables,
They have been declared as measures, and in the property it is
“Function to be used when Aggregated”(Option in Object Properties when we select the Qualification of object) is “SUM” before, now i have changed to “MAX”.
That worked as of now, but i still support your discussion always remove the bug from the root.
Thank You ALL for helping me.I appreciate your help. :smiley:
Thanks again,
Madhu.


madhu@P (BOB member since 2008-08-04)