COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Applemdjs311 on 20 Sep 2016 05:33:13 PM

Title: If there are duplicates, select which to keep.
Post by: Applemdjs311 on 20 Sep 2016 05:33:13 PM
If upc is a duplicate, specify which row to keep based on another attribute.

Ex: If upc is duplicate, keep the row that is NOT brand x. But if the upc is not a duplicate keep whatever product shows.

Upc    Product     
123    Yellow boat       - want to keep
123    Brand x          - want to get rid of this row
234   Green bear        - want to keep
789    Brand x                - want to keep
Title: Re: If there are duplicates, select which to keep.
Post by: sdf on 20 Sep 2016 09:50:16 PM
for the UPC you can use :
total(1 for [Upc]) <--number of occurrences

create a case statement for your Product base on above.
some like if Upc count > 1 then [Filtered product] <--- does not include brand x (i think you can use except)
else [Product]

haven't tried this though just an idea.