SUMMARY:
Prior to Strategy Web 9.0.2, selectors could only be saved with a static element as the default selection. If a selector based off Day was executed on March 27th 2011, then the previous day (March 26th 2011) was picked, if the document was saved and then re-executed on another day (March 28th 2011) the selected element would still be March 26th and not March 27th, like shown below:
March 27th Execution

March 28th Execution

With the introduction of the new feature in Strategy Web 9.0.2, “Use first or last N elements”, saving dynamic elements is now possible.

Using this feature, a selector can be used to default to the last element or 2 last element, or to the first or 2 first elements, depending on which value in the warehouse is equivalent to 'yesterday'.
Example:
If the data in the warehouse is sorted ascending, as in the image below:

The selector should be set to the last element or the last 2 elements, depending on whether the latest row in the column contains the current day or not. If the data is sorted descending, then it should be the first elements.
The sorting in the warehouse can also be overridden by the attribute form’s browse sorting, as explained in tech note KB32916.
If this has been applied correctly, the calendar selector should now have a dynamic state as default which will advance depending on the warehouse changes, not on the actual date. Handling the daily updates of the warehouse data should be taken care of by this point by a database administrator.
RESTRICTIONS:
For this functionality to work correctly, the following restrictions apply.



Note: refer to tech note KB35994 for more information.