COMMON Usage
Posted: Thu Jun 11, 2009 11:09 pm
We have a dimension for capturing all the dates and the corresponding Surrogate ID values , and previously we were using this lookup and got the SIDs from the Hashed File. And later on, we have written a custom routine to convert the given date to the SID value, as it is more like removing the hyphens between the dates, So we did these things in the BASIC routine, it will convert all valid dates to its SID.
Now we got a requirement, that the date value should be within the range which is there in the dimension, Like if in dimesion we have dates only from 2001 - 2020, then only the dates between them should be converted to SID values else it should throw error.
And , I dont want to Change the number of arguments of the routine as it is used widely across the project. So I want to do the things within the routine without changing the arguments. I can do a select from the Dimension Hashed File for getting the Maximum Date and Minimum Date, But it will be very perfomant as it will open the Hashed File for every row. Is there any way we can store the Maximum Value and Minimum Value from the Dimension through some other routines or some way, and validate that value in the Current Routine.
Kindly , Provide some suggestion on how to achieve this?
Now we got a requirement, that the date value should be within the range which is there in the dimension, Like if in dimesion we have dates only from 2001 - 2020, then only the dates between them should be converted to SID values else it should throw error.
And , I dont want to Change the number of arguments of the routine as it is used widely across the project. So I want to do the things within the routine without changing the arguments. I can do a select from the Dimension Hashed File for getting the Maximum Date and Minimum Date, But it will be very perfomant as it will open the Hashed File for every row. Is there any way we can store the Maximum Value and Minimum Value from the Dimension through some other routines or some way, and validate that value in the Current Routine.
Kindly , Provide some suggestion on how to achieve this?