Cognos Analytics

Cognos Analytics

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


#Product
#Analytics
#CognosAnalytics
#Analyticstools
#TechXchange Partner
#TechXchange Session
#TechXchange Presenter
#AI
 View Only
  • 1.  matching multiple columns (two foreign keys)

    Posted 08/26/19 04:27 PM

    I am learning how to use IBM Cognos and my first task is to create relationships between the tables I have uploaded into Cognos.

    Basically, I am trying to tell Cognos to link the id column in the Person Table with the person_id and related_person_id columns in the Relationship Table, as shown here:

    Create Relationship

    However, this does not seem possible since the Match Selected Columns button becomes disabled when I try to also link the related_person_id column.

    The reason I need to do this is because person_id and related_person_id are foreign keys - they point to people in the Person Table and explain how they are related.

    How can this be accomplished in Cognos?

    Thank you.






    ------------------------------
    Nicholas Kline
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: matching multiple columns (two foreign keys)

    Posted 08/27/19 07:37 AM

    You can have any number of matches. You need to match a single query item from each side for each match. A query item can be used in multiple matches.


    You would select person_ID and whatever column you want to match it with from person table csv (presumably ID). You would then select related person ID and whatever column you want to use from person table csv (again presumably ID,  given the data which is showing on the right hand of the editor when you select related person ID.  It isn't clear what you are trying to accomplish but this fairly strongly suggests that you are in a bridge table situation; more anon ).

    The nature of the columns which you want to use in your relationship suggests that this is a bridge table scenario and you want you want a 1.n relationship between ID and person_id and another, n.1, relationship between ID and related person ID or if a 1.n relationship between ID and person_id.

    You would need to create a bridge table which brings in the keys which you want to use. You do this via the create table menu item. You then create relationships to the bridge table with the bridge table being on the many end of the relationships. Finally, in the advanced properties of the bridge table there is a property called usage. One of its values is bridge. Set the usage value to be bridge. This will tell the query engine that the table is to be understood as a bridge table. Normally, the query engine thinks that a table which is at the many end of its relationships to be a fact table. In terms of modelling a messy subject, it is fairly elegant.

    It is, however, also possible that you want to use person_id and related_person_id as a composite key. You will need to create an expression to create the key values which you want to have.

    Hope that helps.



    ------------------------------
    IAN HENDERSON
    ------------------------------