cancel
Showing results for 
Search instead for 
Did you mean: 

Include a loop in a query

nick_vanlent1
Explorer
0 Kudos

We have a loop, which I believe is needed to get accurate results.  However, I can't figure out how to use it in a query.  Here are the three tables in the universe that are in the loop.

When I build a query, I need information from each of these three tables, and I need all three joins to be included.

Without any contexts, I get this error:

"Incompatible combination of tables.  (IES 01507)"

I read somewhere that I might be able to use a context and include all three joins in it.  However, that causes a different error:

"The multi-part identifier "test_types.allocate" could not be bound."  And it appears that the query contains no joins in it.

Any thoughts or suggestions?

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

amitrathi239
Active Contributor
0 Kudos

You need to use context to select the joins path between the table..You can try with "Detect Context" functionality to get the joins path..

or as per your screenshot Test_Types table is holding the detail data of Test table..You can remove th join between LWRS & Test_Type tables in the universe..After that there will be no loop.

nick_vanlent1
Explorer
0 Kudos

On one of the reports used with this universe, we need to show a sum of the "allocate" field in the test_types table for each lwrs record.  The example below shows the records for lwr_id 2382232.  The users are expecting to get 3 for the allocate sum.  However, without the link between lwrs and test_types, the sum would return 10.


Alternatively, if I used the link between lwrs and test_types, and take out the link between lwrs and tests, the sum would return a much larger number, because there are many records in the tests table with these three tt_id numbers (shown below in the obj_id column).


The only solution I can think of is to use a derived table, which joins the tests and test_types table together, and then join that to the lwrs table.  This doesn't sound like too difficult of a solution, but it seems like there should be a mechanism to handle this without needing a derived table.

amitrathi239
Active Contributor
0 Kudos

Other option is enable the shortcut join between lwrs and Test_Types tables..When ever user pick the objects from these two tables then shortcut join will enable and it takes the direct path..