hi all,
I need to add dynamic date in where condition in date field (Table1. DATE field). Dynamic date is always between 1st November and Sysdate. If I ran the query in Dec 2009, data supposed to be display between 1st Nov 2009 and Sysdate (2009 Dec sysdate). Similarly if I ran the report in Feb 2010, data supposed to be display between 1st Nov 2009 and sysdate (2010 Feb sysdate), id I ran the same report in Mar 2011, data supposed to be display between 1st Nov 2010 and Sysdate (Mar 2011 sysdate) and so on…how to write this dynamic where condition ?
One option would be to maintain a period table where you can maintain the start and end dates. The start date would be the 1st date of analysis and the end date would be the date itself. You can alias the fact table and join the alias with this period table with a between clause.
Now any measure pulled from the fact table would automatically sum up the values between the start and end dates.