Question

In BO XI 3.1, is it possible to create a condition object that filters on multiple tables, without adding all of those tables to the query if they weren't already present?

For example, if I have several tables which all contain both current and historical data, and each table has a flag to indicate if the record is current or historical - can I create a single "Current Data" condition that filters all of such tables to pull only current data? The catch would be that the query might not be selecting from all of these tables, and I don't want the inclusion of the condition to add joins to tables I'm not selecting from.

In other words, can a condition check which tables are being used by the query and apply filters only on those tables?

Was it helpful?

Solution

You could add a self-restricting join to each of those tables, and use an @prompt function to ask whether to return current data or historical data. If you use the same text and same datatype for all of the prompts in each self-restricting join, the prompt will only be shown once, and will only be applied to the tables that are actually used in the generated query.

The self-restricting join could look something like:

<table>.<history_flag> 
= @Prompt('Select current or historical data','A',{'C','H'}, Mono, constrained, , {'C'})

In the above example, we assume that the flag is an alphanumeric column (A) with values C or H ({'C','H'}). The user is only allowed to pick from these two values (constrained) and only one value can be chosen (Mono). The default choice is set to current data ({'C'}).

Have a look at the Universe Designer guide for the @prompt syntax. Self-restricting joins are explained in the same manual.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top