≡ Menu

In the series of Business Objects Designer Tutorial in this post we will be learning about loops in Universe how to resolve it.

What is Loop

Loop is a join path problem which causes query to return less records than expected. Loop arises when join between tables forms a closed path.

e.g. in below tables, join arrangement between table forms a loop when these tables are joined in universe.


How to detect loop.

There two ways to detect loop, automatically and manually. You can just view the structure in BO designer and detect the loop visually by seeing a closed or circular join path or other way is detect it using loop detection tool.

  1. Click on Tool
  2. Automated Detection
  3. Detect Loop or click on detect loop icon on toolbar.


How loop causes a query to return incorrect data

Now if you look carefully at country table. Country table has two meaning, country where resort exists and country of a tourist.

Now if you create a report to see number of tourist and their country by each resort country, you will get undesired result. Query will only show data for only that country where tourist country and resort country is same, means it will not show tourist which came from other country.

If you build report on above object, designer will generate query like


( City.city_id=Customer.city_id )

AND ( City.region_id=Region.region_id )

AND ( Country.country_id=Region.country_id )

AND ( Resort_Country.country_id=Resort.country_id )

AND ( Customer.cust_id=Sales.cust_id )

AND ( Sales.inv_id=Invoice_Line.inv_id )

AND ( Invoice_Line.service_id=Service.service_id )

AND ( Resort.resort_id=Service_Line.resort_id )

AND ( Service.sl_id=Service_Line.sl_id )

AND ( Service_Line.service_line = ‘Accommodation’ )

Now if carefully notice the WHERE caluse you will see why result are coming wrong.



Above two joins are putting the restriction causing query to return only those tourists which reside in same country of resort

You can fix the loop issue using Aliases or Context in designer.

Resolve Loops using Aliases

Alias is an alternative name given to table or any other object. Same technique can be used to break the loop in designer.

In our loop problem COUNTRY table is serving two purposes, resort country and customer country. We can break this loop by creating an alias table for country table to separate resort country and customer country as.

Country table will join to resort to become resort country

Country_Regioin alias will be joined to region to become customer country


Now if you create same report you will see

Country_region =Region.country_id


There is now one join applying a restriction on the Country table and another join applying a restriction on the Resort_Country table. Now you can see the loop has been broken.

How to create an alias

  1. Select the table for which you want to create a alias.
  2. Right click on table and from menu click on alias OR
  3. from Insert menu select Alias
  4. Give the new name of an alias
  5. Remove the join from original table
  6. Join the alias table appropriately and set the cardinality.

Once you have created an alias, you would also need to redefine the object to use alias table. In above case origin country should use coutry_region.country column instead of country.country column.

Resolving Loops using Contexts

Context is another way to resolve loops in universe. Contexts resolves loop by defining a set of join that defines specific path through tables in a loop. It makes sure that join are not included from different path in the same query.

Generally contexts are used solve a loop caused by multipurpose lookup table.

3 comments… add one
  • Dilip Dash October 17, 2013, 12:14 pm

    Hi, I tried to implement above scenario (Club Datamart) to check the all joins coming in picture when there is loop. When i pulled objects from City and Country table in query panel,instade of getting SQL i am getting error of “Incompactible Combination of Objects”. Am i missing anything ? Plz help me to understand above concept.

  • sas July 3, 2015, 2:28 am

    I am a new learner. The post is so comprehensive. I tried to implement the same scenario in IDT to have a clear understanding of the output but i got the following error “The query cannot run,because it contains incompatible objects”[wis00008]. i clicked view script to check the code. the same error pops up. Is the above output generated in UDT and not in IDT. i mean to ask if IDT deliberately stops executing the query unless the loop is resolved. please revert.

  • Ankit GHupte April 18, 2016, 10:16 am

    Hello ,

    U ll need to create an alias for country name and use that ina different query city would be joined to country region table and not country
    so these two objects need to be in same query
    and country table should be sepperate in other query

Leave a Comment