Skip to Content
avatar image
Former Member

How to decide which cardinality suits /right for any particular join???

Hello Experts,

i'm new in sap bobj,little confused in deciding cardinality for joins.

how do we decide that here we should use one to many ,here one to one....?????

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 16, 2015 at 11:18 AM

    Hi,

    if you know how many rows of one table will match with rows in other tables then you can manually set the cardinality.

    If not sure then click on the Detect cardinality and designer will check and display the right cardinality.


    Amit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2015 at 12:19 PM

    Information Design Tool has two methods to detect cardinality:

    1. Based on row count. Information Design Tool creates three count distinct scripts in order to count the number of rows in the firtst table, the second table and one script for counting rows from both tables and adds the join, whose cardinality has to be detected in it.If the number of rows in the smaller table (1) equals the number of rows of the third script, it assigns a one-to-many cardinality between table (1) and table (2). This method is slow with large tables, especially when both tables are large and it is sometimes incorrect if the tables are small.
    2. Based on keys. If a joins links a foreign key column with a primary key column then IDT assigns a Many-to-one cardinality between the  foreign key column table and the primary key column table. This method is in my opionion always correct as long as the assignment of keys is correct and it is very fast. Because keys can be maintained on database level and IDT is able to read that information from the database this method is the better one. IDT chooses this method as long as key information is available. Otherwise it uses the row count method.
    Add comment
    10|10000 characters needed characters exceeded