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.