Sunday, March 11, 2012

Best practice for formulating a default value for a queried parameters

In general, what is the most appropriate way to specify a "data driven" default for a report parameter. Seems to me like options are:

1. construct an expression which operates on one of the existing report datasets (possibly the same data set used to populate the defaults dropdown)

2. construct a new dataset which returns a single value which is the desired default

what's the "normal" approach?

For example, I have an MDX dataset which contains the list of dates for which data is available. There is generally some data available for today, but normally the user is interested in the most recent day with data prior to today.

So which would be the better option out of the two above (or a third option if I'm missing something!) to tell my parameter to set itself to:

"The most recent day prior to today for which data exists".

I would think that an expression off of the dataset used to populate the available dates would be appropriate. It doesn't require additional trips for data and decreases the amount of information returned. Of course, this is just an opinion...

|||

that sounds like it makes sense - on the other hand the querying language available through expressions is highly reduced (as far as i can see) compared to MDX (or sql).

So maybe the best approach is:

1. Don't use an expression at all, just reference the dataset if all you want it the first value.

2. Failing that, use and expression if it's simple

3. failing that, use a completely new dataset

No comments:

Post a Comment