What is the Key Date ?
Whilst working with BEx Users, I often get asked to explain what a key date is and how it affects query results. It’s understandable that this can sometimes be a little confusing as you really need to know a little bit about how your BW data model has been designed.
Characteristics can contain attributes, which help describe in detail information about the characteristic itself.
- For example:
The 0EMPLOYEE characteristic holds the value of an employee’s personnel number. This is great but it would be better if we knew more information about this employee. This is where attributes come in. We can assign attributes to the 0EMPLOYEE characteristic that describe more information about the employee such as Job, Position, Gender, Personnel Area etc…
When attributes are assigned to a characteristic, we can add these attributes to our reports in the BEx Analyzer. When we run the report, the BW system reads the attribute values that correspond to the characteristic and displays them in our query results.
Woohoo, I here you cry, but what about the Key Date?
When attributes are assigned to characteristics, there is an option to specify that the attributes are Time Dependant. This means that instead of the BW system reading a single attribute value that corresponds to the characteristic. The system has to use dates to work out if the attribute value is valid for the reporting time period the user has chosen when running the report. This is made possible because when Time Dependant data is loaded into a BW system for a characteristic, a start-date and end-date is loaded with it identifying when an attribute is valid.
Now when a query is executed that displays attribute information; the BW system needs to know what date to use when searching for the relevant attribute information. This is where the Key Date comes in. BW uses the Key Date as a special parameter to read the relevant attribute records that correspond to the characteristic.
You may have designed queries in the past that use attributes but have never specified a Key Date and found that sometimes the correct information is displayed and other times it isn’t. This is because by default the query will use the current system date to find the attribute information if no Key Date is specified for the query, resulting in only the most recent attribute data being displayed.
To ensure your reports display the correct attribute information all the time, make sure you either manually specify the Key Date in your query design or use a variable to determine the date at run-time. This is can be done by selecting the Query Property screen from within the Query Designer.
My preferred method is to always display a parameter that the user must fill when the report is executed.


No comments:
Post a Comment