PDA

View Full Version : Enforced Filters - FORCEFILTER column



Michael Macliver
18-Sep-2015, 08:24 PM
Can anyone point me to the documentation on how this is supposed to work and how you use it? Can you put constant values in there, e.g. 'NZ' as well as @Alias1? As soon as I put anything in there nothing is returned in reports or when browsing the data. It doesn't even come back and say "No records in the list".

Bob Cergol
19-Sep-2015, 02:57 PM
Mike,

You'll find references in the DynamicAIServerGuide.pdf on pages 236, 237 and 276. It could be better, for sure, but basically the only thing you would specify in the dictionary is a user profile Alias#. IMO, it doesn't make sense to expect to define a constant value at the dictionary level. You would do that either in the where clause of a dyn-view, or in the fixed conditions of a report design that dynamically generates a where clause, or as a constant value in the user profile alias#.
9266
In the user profile, Alias1..10 either contains a constant literal, or the name of a so-called alias bundle (think code type value that defines a list of codemast values), or the reserved value @ALL that denotes no restriction for that user on that alias.
9267
The doc on page 276 I believe is obsolete legacy way of defining alias bundles (lists of values for a single alias) that you can define on the alias tab under Administration, General, System, System.
9264
9265
So these are all the places where you can apply a user-profile alias that will result in a dynamically generated where clause on the SQL queries, or in other cases (connections and style sheets) a simple substitution of literal value:

data dictionary; enforced at data source level; most common use-case, most functionality
dyn-view: anywhere in the SQL, however this only works when user profile contains a constant value (not @ALL)
report design fixed conditions
report design free SQL condition/expression (won't work with @ALL or alias bundle; only constant user profile value)
Other global places: connection server name; database name; style sheets


My Synergy 2015 presentation demonstrated this topic extensively and can be viewed here: Synergy 2015/Adaptive Reporting presentation (http://t2889385.omkt.co/track.aspx?id=402|2C16A9|505B|1AA7|11A|0|531|1|6BD B25BE&destination=http://d3mvk1t0iovct7.cloudfront.net/Synergy2015_Presentations/BCergol_AdaptiveEmbeddedReporting_DynamicAI.mp4&dchk=363BEE49)

Bob

Michael Macliver
19-Sep-2015, 06:57 PM
Thanks Bob for your quick reply. I was working off the online help, which says the same thing. I was hoping for something a little more substantial. Only tried a constant to see if I could get something to work.

My problem was that the documentation is wrong, or not complete at worst...

"The dictionary allows for a central definition of @Alias parameters in theFORCEFILTER column, providing a central control – independent from underlying Report definitions – that @Alias restrictions to underlying data are being kept"

Unlike everywhere else, the FORCEFILTER column doesn't work if you put @Alias1, the @ symbol has to be dropped from the alias name. Grrrrr

How about DAI checks for both @Alias and Alias? How hard can it be?

Bob Cergol
19-Sep-2015, 10:20 PM
I 100% agree it is an inconsistency that should not exist, and I was tripped up by it when I was learning the product, and I always point it out every time I demonstrate or talk about using Alias# values.

But the documentation is not wrong in regards to it, though I agree it should emphasize the fact the syntax is inconsistent for a particular, single usage. The documentation describes using @Alias# everywhere with the sole exception when used as a forced filter specification in a data dictionary.

On page 276 it says (my bolding applied):

The new alias1 group values are supported in the following functions in Dynamic AI:
When @alias1 is used as a Condition on the Report
When alias1 is specified as a FORCEDFILTER on a data column through the dictionary for the Report
When = @alias1 is used in Free Where conditions as:"= @Alias1"

So in all places it shows using the @ syntax, except when used in dictionary, it shows NOT using the @ symbol. In the section specifically about dictionaries:
9268

The forced filter entry in the dictionary is the only place where the value entered can be assumed to not be a literal constant. Everyplace else you can use it -- you could also use a constant, so the @ character is the escape character Dynamic is using to know the string of characters is to be replaced dynamically. (I know...and I agree... the dictionary should still also use the @ -- or allow either.)

As far as product documentation goes, while I think there is definitely a lot of room for improvement, I think it's definitely above average in my experience. The documentation for Dataflex does set a pretty high bar IMO.

Regards,
Bob

Michael Macliver
20-Sep-2015, 05:57 AM
Sorry Bob, IMHO I can't agree with you on the documentation. Yes, there's a fair bit of it, but it seems to be fragmented all over the place. Trying to find what you're looking for effectively and efficiently, especially when you're new to the product, I havn't found easy.

I didn't see the entry you refer to on page 276, but I did see the earlier one on page 237 under "Security definitions based on user alias settings". This states "The dictionary allows for a central definition of @Alias parameters in the FORCEFILTER column, providing a central control – independent from underlying Report definitions – that @Alias restrictions to under lying data are being kept".