Rolling date filter to include four full months

Hello all,
I have a request to create a report that will be a rolling date. They want it to be four months including all in the current month we are in. Can anyone help with the SQL statement that I need to use?
In the On Demand Reporting book they have (using "In Between"):
CURRENT_DATE
CASE WHEN DAY (CURRENT_DATE) = 1
THEN CAST (TIMESTAMPADD (SQL_TSI_MONTH, 3, CURRENT_DATE) AS DATE)
WHEN DAY (CURRENT_DATE) <> 1
THEN TIMESTAMPADD (SQL_TSI_MONTH, 4, TIMESTAMPADD (SQL_TSI_DAY, -DAY(CURRENT_DATE), CURRENT_DATE)) END
But what I need is for it to not just pull todays date plus three months out, I also need to include everything from the current month we are in.
THANKS IN ADVANCE!!

Hey,
This will do the trick:
[Your Date] >= TIMESTAMPADD(SQL_TSI_MONTH, 0, TIMESTAMPADD(SQL_TSI_DAY, -(DAY(CURRENT_DATE)-1), CURRENT_DATE)) AND [Your Date] <= TIMESTAMPADD(SQL_TSI_MONTH, 4, TIMESTAMPADD(SQL_TSI_DAY, -(DAY(CURRENT_DATE)), CURRENT_DATE))
It includes everything from the 1st of the current month to the last day of the 4th month.
Thanks
Oli @ Innoveer

Similar Messages

  • Next full month function

    Post Author: kimiko
    CA Forum: Formula
    Hi,
    I am new to Crystal, so I hope this question makes sense...
    I am trying to use a function to select the next full month based on the current date. The 'lastfullmonth' function works for me, but I need to obtain the next full month rather than last month. The 'next30days' function will not work because it does not include a full month. For example, today is November 27, and I need to view all of December. If I use 'next30days,' I will see the end of November and it will not reach to the end of December. Is there a function or formula to view the next full month?
    Thanks in advance!!!

    Post Author: yangster
    CA Forum: Formula
    this issue becomes a lot easier if you add the custom function cdlastdayofmonth and cdfirstdayofmonth from the repositorydatetimevar begin_date := cdfirstdayofmonth(dateadd("m", 1, currentdatetime);datetimevar end_date := cdlastdayofmonth(dateadd("m", 1, currentdatetime);your_date_field in begin_date to end_datesimply log into your repository, navigate to the date formulas and right click to add to report and you will be able to use the custom functionsthis can also be done with some manual date manipulations but its rather messy

  • 12 months Rolling data

    Hai friends,
    Urgent requirement. Plz help me out.
    I have time characteristics Fiscal year(0fiscalyear) and Posting Period (0fiscper3). Based on these I will create 2 user input variables one for fiscal year and another for posting period. Now Based on input , I have to get 12 months rolling data. Key figure is sales.
    suppose user enter fiscal year as 2008 and posting period as 02. I have to get sales data for 01/2008,12/2007,11/2007...................02/2007.
    I have to write user exit. Plz help me with ABAP code. Am weak in ABAP coding. Help will be rewarded.
    Full points assured if the answer is helpful.
    thanks in advance
    Edited by: siddharth on Feb 7, 2008 5:33 AM

    Hai pradhiba,
    Thanks for your response. But there is no data for 0fiscper(fiscal year/period) in my cube. That is the problem. SO i have to write exit. Plz help me out. Its an urgent requirement. I have to do it today and submit to client.

  • BIP eBusiness Suite Dates - How to include the last day of the month?

    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    I have a report that will generally be run for a month but can be run for any pair of dates representing the first and last date to be included in the report.
    When we pass the dates from Oracle Apps to the report it is truncating the date to midnight. This results in the last date entered 'NOT' being included in the report as the second date is marked as "midnight". When I attempt to simply add "=1" to the end date it fails due to formatting issues in apps (only). I have gotten this to work on our Enterprise edition server that we use for testing (only) but it fails in our apps environment.
    In APPs we input the date in the format "01-AUG-2007", and this is how it shows in the parm line before the report is submitted as well as in the "View Details" after the report is executed: http://home.swbell.net/grog1//work/req_details_5607586.jpg
    However it is odd in that we in the "View Log" entry it shows the date formatted as "2007/08/01 00:00:00": http://home.swbell.net/grog1/work/view_log_5607586.jpg
    Even odder is that under diagnostics, "View XML" the date is formatted third way as: "2007/08/01 00:00:00.0" (note it now includes tenths of a second): http://home.swbell.net/grog1/work/view_xml_5607586.jpg
    This of course makes it difficult to perform conversions and calculations on the date in the SQL.
    Is APPs doing some sort of 'timestamp' conversion?
    How can I get my report to include the last day of the month 'without' forcing my users to enter the non-intuitive first of the next month as a parm?
    Any feedback is appreciated,
    Scott

    No. The problem/error occurs long before the data is formatted into xml for presentation to the format template.
    The error occurs in the SQL in the 'data' template when I attempt to add a day to the date. It either does not like the implicit conversion with the "+1" and then the use of the "between" with another date or if I attempt to manually convert it has problems with the format mask.
    Scott

  • Does the 12 euro per month package include a full version of lightroom and photoshop

    I wonder if the proposed limited package of 12 euro per month (if submission for a whole year) includes the full version of photoshop and lightroom or is it limited in use ? for exemple maximum of ... hours per month of GB per month etc...?

    Hi DJL-photo ,
    Welcome to Adobe Forums
    The Photoshop Photography Program Plan do not have any limitation of Usage , Its a Subscription with a one year committment where in you will be charged on monthly basis .
    How ever if you want to store any files etc , then we have 20 GB space for storage like in Creative Cloud
    Let us know if that helps !
    Thanks
    Garima
    Message was edited by: Garima.J

  • Substruct 2 Dates and get full month difference

    HI,
    I have a start Date coming from a DB like 3/10/2006
    and I have the Date of today like 5/20/2006.
    I need to find the difference in full months between this 2
    dates???
    return should be like >TimeUsed.text = "3";
    Can someone help please?
    Thankyou

    Flash already knows the current date, so you could use
    something like:
    aDate="3/10/2006";
    TimeUsed.text = monthsBetween(toDate(aDate),new Date()));
    //followed by attached code
    If you are given both dates, from database....
    aDate="3/10/2006";
    bDate="5/20/2006";
    TimeUsed.text = monthsBetween(toDate(aDate),toDate(bDate));
    //followed by attached code

  • Sytanx for 12 months rolling data

    Hi,
    What is the syntax for generating the last 12months rolling data?
    I
    tried with this syntax but does not seem to work.  When crossed verified with the dates, its showing all the dates.
    Datediff("m",Date({CHG_Change.Considered Res Time}),CurrentDate)<=11
    Regards
    Cauvery.

    It depends what you want , do you want 12 months from current date or 12 months from the start of the month of the current date.
    12 months from current date
    {CHG_Change.Considered Res Time} > dateadd("m", -12, currentdate)
    it will automatically calculate midnight for start date
    12 months from 1st of month
    {CHG_Change.Considered Res Time} > date(year(dateadd("m", -12, currentdate)), month(dateadd("m", -12, currentdate)
    ), 1)
    Ian

  • How to filter on rolling date?

    is there a reference page somewhere for all the power query built in date functions? ie dateadd()?
    I'm reading data from an RSS feed (http://sentinel.ga.gov.au/RSS/sentinelrss.xml) but want to filter to recent observations (12rs) only.
    Adding a date filter using the gui adds a hardcoded #datetimezone(2014 etc etc) call
    I want to do something like
    = Table.SelectRows(ChangedType4, each [OBS Time] > 
    DateTimeZone.FixedUtcNow minus 12hours)
    is this possible? I see AddDays()/AddWeeks() methods but no add hours/minutes/seconds
    Jakub @ Adelaide, Australia

    There is no library function to do arithmetic over a DateTime value at the level of hours, but you can use the #duration directive to create a 12 hour duration and subtract it from the original datetime value.
    For example:
    Table.SelectRows(ChangedType4, each [OBS Time] >  #duration(0,12,0,0)
    You can read more about it in Power Query language specification:
    http://go.microsoft.com/fwlink/?LinkID=320633
    Zafar Abbas

  • Show data of last day of previous month against any day of current month

    Hi,
    I have fact table which contains data at date level (we have data for oct-2009 to april-2010). Our requirement is to show data of last day of previous month against any day of current month in obiee 11g. I am facing problem in Feb 2010 its picking data of 28-Jan-2010 instead of 31-jan-2010 and for April its picking data of 30-mar-2010 instead of 31-mar -2010.
    Any suggestion ???

    You're asking to filter your data set to only include rows between:
    1) last day of the previous month
    2) any day of the current month
    This can be achieved with prompting in OBIEE Answers.
    last day of previous month = TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) . The problem is you need to make query work within Oracle's Answer syntax.
    In the prompt, select the operator type for your date dimension as 'between' and default to 'SQL Results'.
    For the 'last day of previous month' , use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    For the current date, use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else CURRENT_DATE
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    Another option is to create a last_date_pervious_month variable in the RPD and have that as the default value in your prompt.

  • Need to backup and remove photo library form my iphone.  This library was previously backup on a hard drive that crashed.  So these photos are only in the photo library and not in the camera roll.  If I do a full backup, it only takes the camera roll.

    Need to backup and remove photo library from my iphone.  This library was previously backup on a hard drive that crashed.  So these photos are only in the photo library and not in the camera roll.  If I do a full backup, it only takes the camera roll.
    So this is a 2 part question:
    1) how to I backup the Photo Library to my new hard drive (as the last one was unrecoverable but previously backed up)
    2) how do I remove the Photo Library form my phone (preferably after backup in item 1)
    Thanks, Janis

    Since it has always been very basic to backup your computer and all it's data, Apple provides no way for you to transfer music from your iPhone back to your computer.  As you know, you can re-download all iTunes purchases, but music that you ripped yourself you'll have to just re-rip again.
    You can try and find 3rd party applications that might help you.  I'm sure you'll pay, however.
    Let this be a very important lesson learned.
    Best.

  • How can I find out my data usage for the past 3 months?

    Greetings all, I have been a long time Verizon customer, and as such I, along with my husband, was grandfathered into the unlimited data plan. When I last spoke to a representative, they informed me that the only way we were going to be able to keep our unlimited data was by paying the full retail price ($600+) to get a new phone. So we were considering upgrading and changing to one of the newer data plans so we could still get the discounted price on the new phone, but I would like to make sure I choose one with enough data, without paying for a bunch of data that I don't use, however MyVerizon only shows me the amount I have used since the start of the billing cycle. Is there a way to find out the data usage for both my husband and myself for the last 3 months so I can choose the right option?
    Thanks in advance for your help!

        Hello sweetpea1221! How exciting that you're considering upgrading with us. mrhelper is helpful, indeed. You can view your data usage for each line under the View Bill option via your My Verizon account. You can also view your 3 month average  data usage with our Account Analysis feature. Here's a link that will be helpful in doing so http://bit.ly/vnLjqO. I'm confident that we have a great plan to match your data needs. Please let us know if you have further questions.
    TanishaS1_VZW
    Follow us on Twitter @VZWSupport

  • How can I generate a data merge that includes a barcode from excel spreadsheet to InDesign?

    Can you please advise if the following process is possible within InDesign CS 5.5? (Mac OS 10.8.2).
    We need to create a data merge that includes a barcode. The data merge is for several thousand records.
    We have a customer-supplied Excel spreadsheet that contains seven fields, one of which is a number that ultimately needs to print as a barcode when we make the data merge in InDesign.
    As you would expect, the conventional six fields data merge perfectly - but we can't find a way to make the barcode print correctly within the data merge.
    We have investigated several possible solutions without success.
    Some solutions suggest a plug-in for Excel to convert the number into a barcode whilst still in the spreadsheet - but this doesn't come across correctly when we import the CSV file into the InDesign data merge.
    We have investigated certain third party software applications but none provide the full solution we require. Some, for example, appear to create the barcode within the Excel spreadsheet but don't produce the barcode correctly when we data merge in InDesign; and some will allow us to create a one-off barcode within InDesign but have no automated way of retrieving the thousands of Excel numbers and turning them into barcodes.
    We have also come across possible 'font' solutions but have had no success with these either.
    For a previous job we needed to produce we outsourced to a specialist mailing company, who assured us they produced the whole job (very quickly) within InDesign. They, understandably, won't tell us how they did it. But, given the speed with which they produced the job for us, we imagine - with the correct software - the whole process is easy to do.
    Can you please advise?

    See second posting atHow do I generate a data merge in InDesign from an excel spreadsheet which includes a barcode

  • BO Report Mobile - date filter

    Hello!
    I have a report in BO Mobile developed with web intelligence tool with two fields of sales values​​, one daily and one monthly. I'm having the following problem: when I select a specific date to the monthly values ​​are equal to the daily values​​.
    Could someone help me.
    It is possible to apply the date filter, make the monthly accumulated values ​​remain?
    Sincerely.
    Gleziane

    Hi
    At Universe level you can create two measure values like daily sales and MTD monthly sales =@
    suppose say yu run the query on date 19-5-2014
    for First measure daily sales where date =@prompt value (i.e date prompt)
    for 2nd measure Monthly sales where date<=@prompt value AND Month=month(@prompt )
    the above is for MTD
    Hope this helps u
    Thanks & Regards
    Sunil

  • Table date filter not working properly

    Hi OTN,
    I have noticed that table date filter not always working properly.
    When I copy actual value from column outputText to column filter and hit Enter - I see an empty table.
    http://imageshack.us/photo/my-images/818/filter.png/
    I suspect the problem to lie among date formats.
    But I tried to delete convertDateTime from outputText or add it under filter inputDate. Nothing helped.
    <af:column sortProperty="Hisdate" sortable="true"
                                     headerText="#{bindings.InformationView1.hints.Hisdate.label}"
                                     id="c8" visible="false" filterable="true"
                                     width="83">
                            <af:outputText value="#{row.Hisdate}" id="ot5">
                              <af:convertDateTime pattern="#{bindings.InformationView1.hints.Hisdate.format}"/> // or without both lines
                            </af:outputText>
                            <f:facet name="filter">
                              <af:inputDate id="id15"
                                            value="#{vs.filterCriteria.Hisdate}"
                                            columns="8">
                                <af:convertDateTime pattern="#{bindings.InformationView1.hints.Hisdate.format}"/> // or without both lines
                              </af:inputDate>
                            </f:facet>
                          </af:column>Nothing special about the attribute. A database table field of type DATE. In database this (see picture) row has exactly "06.06.2006".
    Could you please point me out where to start seeking?
    Thanks.
    JDev 11.1.1.4

    Well, OK. I think I'd better have 2 attributes: truncated date for filter and full date with time for edit.
    What is an attribute type for datetime?
    select trunc(t.HISDATE) AS HISDATE -- date attribute type
        ,to_char(t.HISDATE, 'dd.mm.yyyy hh24:mi') AS HISDATETIME -- timestamp/date attribute type?Something like this?

  • IDOC: Problem with data filter for IDOC extension field

    Hallo!
    I've created an idoc extension for the basic type DEBMAS06 that works fine. Now I want to use a data filter for one field ( company code ) of my segment. Every segment with a company code different from 100 should be filtered and not send to the other client. But what happend is that for all customers that have at least one company code different from 100, all segments including the one with cc 100 were deleted and a error "Segment ... does not exist for message type DEBMAS" appeared on the screen.
    Does anyone have any ideas about this problem?

    Not sure about changes to be made at the filtering options.
    An alternative would be sending the data to XI as it is and perform the mapping to remove the unnecessary segments.
    Disadvantage: Unnecessary processing of segment would be done at XI.
    Advantage: The integration logic would be completely handled by XI.
    Regards,
    Prateek

Maybe you are looking for

  • Trying to use a java 32bit program in Arch 64bit

    After giving up some time ago, I decided once more to try to run a commercial 32bit Java application in my Arch 64bit. The same program runs fine in a vm with Ubuntu 64bit. Also, I installed bin32-jre from aur and I messed up the jre.sh and jdk.sh sc

  • Getting KERNEL_SECURITY_CHECK_FAILURE (bugcheck: 0x00000139) crash every day

    Sometimes it's twice a day. Every time I come back to my computer and find that it's on the login screen, I know that it crashed and rebooted. I think there could be some connection to the USB subsystem. Often times, my keyboard won't work after a cr

  • Bad playback on Apple TV

    I'm having horrible, stuttering, non-responsive playback with movies that are NOT streaming to my apple tv, they are stored on it. WHY?

  • How to get music after computer lost in fire?

    My computers were lost in a total house fire. I have now purchased a Mac and would like to get the music I purchased onto my iTunes. I can see the purchases in my account. I obviously have no file to transfer from the old computer, so how do I get th

  • Music Card in Italy

    Hi, I want to buy an iTunes Music Card in Italy. Do anyone know, where I can buy one? Thanks, Mammut