Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9564

Re: Last 12 months based on particular date

$
0
0

Hi RUC,

 

if you are using Oracle data sources then you can add predefined filter with logic as below in the universe and use it in the report query.

 

Table.Sales_Date between add_months(add_days(last_day(Table.Sales_Date),1),-12) and last_day(Table.Sales_Date)

 

add_months(add_days(last_day(Table.Sales_Date),1),-12) - Derive at the first day of next month from the given sales date and subtracting 12 months from there.

 

last_day(Table.Sales_Date) to ensure you are getting data until the last date of the month given by the sales date.

 

Hope this helps

 

Thanks

Mallik


Viewing all articles
Browse latest Browse all 9564

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>