At universe level, I have to create predefined filters for previos month, previous 2 months and previous 6 months. In universe we have Monthyear object (date format like 1/1/2009) and monthyear-char object (character type and data like jan 2009). I know how to create these filters using sysdate but the data is not upto date. So I want to use one of those 2 objects to create those predefined filters.
I would recommend creating a derived table that has all the date ranges pre-defined. You can either define the derived table in the universe or as a view in the database – both work. It would look something like this
Select ‘All Days’ as DATE_RANGE, min(DATE) as DATE_RANGE_MIN, max(DATE) as DATE_RANGE_MAX from DATES_TABLE
union
Select ‘Today’ as DATE_RANGE, max(DATE) as DATE_RANGE_MIN, max(DATE) as DATE_RANGE_MAX from DATES_TABLE
Either this can be exposed as an object directly in the universe or as a condition object with a prompt. This would be the most flexible way of approaching this.