I have a requirement to build a report that fetches data for the last 3 months. I dont want to create a report every month that fetches data for last 3 months. I want to create a report and schedule it so that when ever it runs it fetches data for the last 3 months. For example if I run my report today it should fetch data for May, June, July and when it runs in Sept it should fetch data for June, July, August.
Is this possible?
Can you please give me more explanation on this. What I understood is that I have to create queries based on sysdate. Can you please give me some examples!
Thanks, but it looks like my issue is more complicated than I expected.
I defined below objects
vol1=table1.cur_vol where table1. month=to_char(add_months(sysdate,-3),'YYYYMM') for May and vol2=table1.cur_vol2 where table1.month=to_char(add_months(sysdate,-2),'YYYYMM') for June and so on
But if I drag drop 2 or more months into my report my report , it fetches no data. It works fine if my report has one month. Say if I select Customer name and May volume as report objects it works fine but if I add JUne and/or July vol to my report it fetches no data!
If you applied the condition that I mentioned above then the report would always retrieve data only for the last 3 finished month. So for instance, if you ran the report now it would fetch data for May, June, July. Next month, the same condition will fetch data for June, July, August. Etc. etc.
Do you have a calendar table (date dimension) in your database? If yes then join it to your transaction table. Create a “month name” object from the calendar table. Then create a measure “volume” from the transaction table.
So then, when you select “month name” and “volume” objects and use the dynamic date condition mentioned above, you will get data (the measure) for 3 months as you need it.