Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  How to remove the duplicate email id's in string data type field

    Posted Sat August 10, 2024 11:58 AM

    Hello Dear Expertise,

    I need your expert suggestions for removing duplicate email addresses in a concatenated string with comma-separated email addresses in the Cognos report (version 11.2.4).

              Eg: abc@gmai.com, def@gmai.com, and abc@gmai.com,

             Expected result is: abc@gmai.com, def@gmai.com

    I tried using macro functions like the one below. However, I encountered an error.

           1.unique ([Query2].[Data Item1]

           2.#unique ([Query2].[Data Item1]#

           3.# csv ( unique ( array ( [Query2].[Data Item1 ) ) ) #

    Regards,

    Yugandhar J. 



    ------------------------------
    Yugandhar Jebiti
    ------------------------------


  • 2.  RE: How to remove the duplicate email id's in string data type field

    Posted Tue August 13, 2024 10:48 AM

    Is this Concatenated String stored in the Column of a Data Source?



    ------------------------------
    Andrei Istomine
    Open to work - anything Cognos
    https://www.linkedin.com/in/andreii/
    ------------------------------



  • 3.  RE: How to remove the duplicate email id's in string data type field

    Posted Mon August 19, 2024 08:10 AM
      |   view attached

    Hi Andrei,

    The Concatenated String stored in "Data Item1", More details are attached. 



    ------------------------------
    Yugandhar Jebiti
    ------------------------------



  • 4.  RE: How to remove the duplicate email id's in string data type field

    Posted Mon August 19, 2024 09:15 AM

    Hi Yugandhar,

    You could get unique list using Macro functions. But you can't use them with the data coming from a datasource.

    You can try to use Cognos functions substring_regex, positions_regex and occurence_regex. Unfortunately, Cognos implementation of Regular Expressions is somewhat limited.

    Your best bet is to use your DB Regular Expressions if they are available.



    ------------------------------
    Andrei Istomine
    Open to work - anything Cognos
    https://www.linkedin.com/in/andreii/
    ------------------------------