Skip to Content
avatar image
Former Member

lesser records in loops and more records in Traps

HI Experts,

I Have Studied Each and very forum regarding Loops and Traps and Alias and contexts . . I got some Idea But still Confused. I Have went through Below Blog dave.

Dave’s Adventures in Business Intelligence » Context Versus Alias Overview

i got conclusion But still I am Confused and have some questions so that its time to shoot out Questions .hope some one will answer my questions and make me out from this confusionšŸ˜Š

Here are the Questions that i Have from so many days

1. Why Loop Will get less Records whats Logic is there in Backend? can any one explain with example

2. Why Trap will get more records? can any one explain with example

3. IN earlier while doing POC i face situation Many to Many Joins between tables as dave mention you should correct your data model?

What does it mean? When we get wrong results with Many to many joins which approach I need to follow?

4. What will happen if Fact table--> Fact table--> Lookup table with 1,n,1 will it be a Trap?

and Fact table--> Lookup Table--> Fact table with 1,n,1 will it be Trap ?

I Am Confused a lot in all these things .

Any One could explain clearly Really Highly Appreciated

Thanks,

Varun

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 18, 2016 at 04:01 AM

    Hello Varun,

    Here's some facts that should help you based on my understanding.

    1. Why Loop Will get less Records whats Logic is there in Backend? can any one explain with example.

    When you encounter a loop you have more number of joins Like A to B, B to C and C to A. So more the number of joins in your SQL statement less the number of records you will get. You can test the results on any back end its the same in Designer as well depending on the type and number of Joins your records gets restricted.

    2. Why Trap will get more records? can any one explain with example


    Trap will get more records in the sense say for example you have a Table A having one to many relationship with Table B and Table B has one to many relationship with Table C. So as a result of that for one particular entity you have many records in B and for those many records you have again so many records in Table C which causes Fanned results SO you have more number of records.


    3. IN earlier while doing POC i face situation Many to Many Joins between tables as dave mention you should correct your data model?

    What does it mean? When we get wrong results with Many to many joins which approach I need to follow?

    Yes its correct you should handle Many to many relationship at the Database level and best approach is to make use of intermediate Factless fact table which contains only the Foreign Key relationship so breaking the N:N to N:1:N

    4. What will happen if Fact table--> Fact table--> Lookup table with 1,n,1 will it be a Trap?

    and Fact table--> Lookup Table--> Fact table with 1,n,1 will it be Trap ?

    Please take a look at the data model do you think this could happen in a realistic scenarion and if so make use of Alias.

    Hope this helps.

    Regards

    Niraj

    Add comment
    10|10000 characters needed characters exceeded