How to get the fiscal year previous last day?

I created a line of dashboard with a column of the calendar date. Duty of the user is to display the previous year sales last day i.e. 31 March of the year for the date played.

How is it achievable? Please answer anyone who implemented logic.

Fiscal year starts from 01 Apr.

Dear Philippe,

Sometimes we are not able to provide a complete solution for you, but we can guide you because we are a busy lot in our own tasks... here, I worked a formula for you...

-case when Date ' @{PV} {2014-04-04}<=TIMESTAMPADD(SQL_TSI_MONTH, 3,timestampadd(="" sql_tsi_day="" ,="" extract(="" day_of_year="" from="" pv)="" *="" -(1)="" ,="" pv))="">

TIMESTAMPADD (SQL_TSI_MONTH-9, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR pv) *-(1), pv)) else

TIMESTAMPADD (SQL_TSI_MONTH, 3, TIMESTAMPADD (SQL_TSI_DAY, EXTRACT (DAY_OF_YEAR pv) *-(1), pv)) end

I could not test this by obiee. But have a try and let us know if no door.

Thank you

AJ

Tags: Business Intelligence

Similar Questions

  • How to get the fiscal years

    Hi Experts,

    My query below is beginning of quarter end and previous quarter start and end dates according to the calendar year... Now, I have to get the values accordingly exercise...

    Thanks in advance for the support...
    SELECT   MIN (t)"CURNT_QTR_ST_DT", MAX (LAST_DAY (t))"CURNT_QTR_END_DT", ADD_MONTHS(MIN (t),-3)"PREV_QTR_ST_DT", ADD_MONTHS(MAX (LAST_DAY (t)),-3) "PREV_QTR_END_DT" INTO V_CURRQTD_STRT ,V_CURRQTD_END,V_PRVQTD_STRT, V_PRVQTD_END
    FROM (SELECT ADD_MONTHS (TRUNC(TO_DATE(TO_DATE(V_RPRT_DATE)), 'YYYY'), LEVEL - 1)  t,
          TO_CHAR (ADD_MONTHS (TRUNC(TO_DATE(TO_DATE(V_RPRT_DATE)), 'YYYY'), LEVEL - 1), 'Q')QTD
          FROM DUAL
           CONNECT BY LEVEL <= 12) A
           WHERE A.QTD  = V_QUARTER_NUMBER;

    Hello

    You don't need the double table much in PL/SQL.

    Another thing that makes PL/SQL, SQL different programming, it's that, in SQL, you can assign an alias for a column, but you can only refer to this alias in a Super application (or in an ORDER BY clause). In PL/SQL, you can reference a variable once it is set.

    In PL/SQL, once you have a DATE deadline in t, you can set the 4 variables like this:

    v_currqtd_strt := TRUNC (t, 'Q');
    v_currqtd_end  := ADD_MONTHS (v_currqtd_start, 3) - 1;
    v_prvqtd_strt  := ADD_MONTHS (v_currqtd_start, -3);
    v_prvqtd_end   := v_currqtd_start - 1;
    

    Use SELECT... IN PL/SQL when the data in a table, and you must copy these data in variables. (It seemed that you forgot the INTO clause in your last post).
    However, in this case, no data in a table you need to copy, it is not necessary for a SELECT statement.

  • How to get the difference in dates in days

    Hi friends,

    How to get the date difference between two dates exactly

    date2-date1 days exactly... shouyld rounded to the nearest value of...

    and one entire display i mean positive integer
    Select round ((sysdate) - to_date (date_start)), date_start days of per_periods_of_service

    This gives negative also result

    Hello

    776317 wrote:
    Hi friends,

    How to get the date difference between two dates exactly

    date2-date1 days exactly... shouyld rounded to the nearest value of...

    Date1 - date2 is the exact number of days is after date2 date1. (It is as accurate as possible, given that the DATEs do not have fractions of a second).

    and one entire display i mean positive integer
    Select round ((sysdate) - to_date (date_start)), date_start days of per_periods_of_service

    You want to probably get the exact number of days first, then ROUND this number:

    SELECT  ROUND (SYSDATE - TO_DATE (date_start, ...))   AS days
    FROM    per_periods_of_service; 
    

    Always pass arguments at least 2 to TO_DATE:
    (1) the string to be converted, and
    (2) a saying string how (1) is formatted

    This gives negative also result

    Right; If date1 is before date2 then date1 - date2 returns a negative number.
    If you want to never get a negative value, use ABS (date2 - date1). If it returns 4, then you know that one of the DATEs was 4 days before the other, but you won't know who was earlier.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • How to get the product key I purchased previously?

    How to get the product key I purchased previously?

    Depends entirely on how you bought it in the 1st place.

    A boxed product should have the key on the DVD case, which is the only trace.

    An update Anytime, you should have the key in an e-mail message from Microsoft. If you log in the website to store, you should be able to find the email conversation.

    If another provider such as a key, then you will need to go back to them.

    If your Windows starts now while you can use a keyfinder utility to read the registry key.

  • How to get the Date, month, year of the DateTimePicker

    Hi, I am using the DateTimePicker.

    There are several question about this command:

    1. how to get the Date, month and year?

    -With the help of myDateTime.value, I get this string ' Wed May 08 14:45 ICT 2013 '-> I have to manually analyze this? Because I need in format yyyy/mm/dd. Or can set the format of dateTimePicker.value?

    2 format on dateTimePicker self (on the user interface) is d/m/YY, I can't change to another format?

    Thank you

    dateTimePicker.value return a QDateTime not a string.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__datetimepicker.html#property-value

    See more:

    https://developer.BlackBerry.com/Cascades/reference/QDateTime.html#date

    https://developer.BlackBerry.com/Cascades/reference/QDate.html

    You can get

    day = dateTimePicker.value.date().day()
    month = dateTimePicker.value.date().month()
    year= dateTimePicker.value.date().year()
    dateYYYYMMDD = dateTimePicker.value.date().toString(Qt::ISODate)
    dateYYYYMMDD2 = dateTimePicker.value.date().toString("YYYY/MM/DD")
    dateYYYYMMDD3 = dateTimePicker.value.toString("YYYY/MM/DD")
    
  • How to get the last access to the workflow? (OM, WMS) release 11.5.9

    Hello my friends.

    I am looking for information on how to get the date of the access and the user name who did use some WFs in OM and last WMS.

    If it is through the application or running in the background via SQL for the information is not important to me.

    Could you help me with this?.

    Thank you

    the 'item_type' attribute must match the name of the WF?

    Yes (internal name. For example OEOL).

    The custom of those who will not be affected by the upgrade.

    You must run the query that I provided before to identify if the workflow is used or not.

    For the workflow of order lines, it is intended to be used as you use the order management.

    Kind regards

    Bashar

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • How to get the last day of a month for every 2 months for a given period?

    Hello

    Can is it some please let me know how to get the last day, last day of the week, the weekend last day, last Monday, one month for every 2 months for a given period?

    Thanks in advance.

    Try the below

    SELECT LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))) lastday.

    BOX WHEN TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') = 'SAT '.

    SO LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))-1

    WHERE TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') = 'Sun '.

    THEN LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))-2

    Of OTHER LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    END as lastweekday,

    BOX WHEN TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') IN ('Sam', 'SUN')

    THEN LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    Of OTHER LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    -(TO_NUMBER (TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))),' from)) - 1).

    END as lastweekendday,

    BOX WHEN TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') = 'MY

    THEN LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    Of OTHER NEXT_DAY (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), "LUN")-7

    END AS lastmonday

    FROM (SELECT SYSDATE startdate,

    SYSDATE + 300 enddate

    THE DOUBLE)

    CONNECT BY LEVEL<=>

  • How to get the last day of the week?

    HII

    I can get the week number of calendar for a given date using

    SELECT to_char (to_date('04/04/2011','MM/DD/YYYY'), 'WW') FROM dual

    can any body tell me, how to get the last day of the week?

    and the answer should be: 04/08/2011(8th april)
    Thank you
    San

    Published by: sandeep9 on April 4, 2011 03:50

    Perhaps this...

    SQL> select trunc(sysdate,'WW')+6 from dual;
    
    TRUNC(SYSDATE,'WW')+
    --------------------
    08-APR-2011 00:00:00
    
    SQL>
    
  • How to get the video intro off my google home screen I already saw it, where is the firefox logo used to be.

    How to get the video intro off my google home screen I already saw it, where is the firefox logo used to be. I started with the last update that I rebooted.

    Hello
    to change the homepage when opening firefox-press 'Alt' and click on tools-> Options.

    Main menu, you can change the URL.

    If the problem persists, you can follow these simple steps:

    Enter about: config in the address bar and press ENTER. Accept the message of 'dragons' to see the Advanced preferences screen. Use the above search box to enter the below pref.

    You can assign an empty string to stop your Firefox to retrieve "extracts" and brandLogo changes the browser.aboutHomeSnippets.updateUrl pref. Right-click this pref and select Edit then clear the value as pref in the box that appears, and then click OK. Who will also disable "snippets" that appear under the container of the research on the default home page.

    Then you must open the folder of your profile, via help > Troubleshooting Information > profile folder > > button view folder. Then close Firefox. Your profile file open with Firefox closed (Firefox '3-bar' menu key > exit/Quit), wait or two minutes, then remove the storage\moz-safe-about + home folder in the Firefox profile folder to remove the brandLogo and stored in IndexedDB code snippets to make Firefox use the default brandLogo and a defined default code snippet.

    If you later change your mind about these changes, you can reset the pref browser.aboutHomeSnippets.updateUrl via the context menu and Reset allows to retrieve the default value using the storage\moz-chest-fort-about + home folder again.

  • How to get the maximum number of days in a month?

    How to get the maximum number of days in a month?

    I use a dateField. where I can get the month. Now, I want to get the maximum number of days in a month.

    How can I get it?

    Please help me. and thanks in advance... []

    NET. RIM. Device.API.util
    Class DateTimeUtilities

    getNumberOfDaysInMonth (int month, int year)
    Returns the number of days in the specified month

    It took me like 10 seconds to find it in the API, I guess you spent more time writing the post...

  • How to get the time of the device

    Hello

    I'm developing an application in which I send location of the device in lat, long for every 10 minutes.  I want to send some time also with lat, long. This time must be peripheral situation updates for every 10 minutes.  Can someone tell me how do I do this?

    It is not obvious to your OP exactly what you ask.

    Ask you in a certain way a consistent recording time no matter what time zone are you in?

    Or are you just asking how to get the date and time?

    If it's the last QDateTime is one of the ways to get the date and time...

    http://developer.BlackBerry.com/native/reference/Cascades/QDateTime.html

    If you ask for the first answer more complex, you will probably need to check the time against an external clock (say GMT) and then re-reading use the contact information you have saved to determine what the weather was (including a calculation of DST) at this point in this particular time zone.

    Relying on the phone to change accurately that it is time that you move in time zones will not give accurate results.

  • Windows XP mode - 7: how to get the Realtek Audio Drivers with GS Wavetable outside normal? Instead of RDP Audio driver!

    1. I upgraded my comp to Windows 7, Ultimate because I need to use many XP programs. What I've discovered, is the virtual XP Mode is not the same thing as XP regular and many programs do not run properly. Particularly theAudio out to lunch and MS GS Wavetable is not available in XP Mode.

    2 - I end up having to buy another XP-Professional and installed in the same notebook. I have to turn off the laptop restart and select the Windows 7 to XP operating system. All old programs work fine under XP.

    3 - I continued looking for a fix for the XP Audio Mode or virtual. Almost 2 years now, I can not find such a simple solution.

    4. today, I found something on the Microsoft RDP Audio driver. What is the reason? Anyone know?

    5. are there available MS drivers or resources?

    I'm not interested in the commercial programs or attempts to scan my computer. MS sold Windows 7 that can run XP so I think that Microsoft is responsible for fixing.

    Thanks in advance,

    VT

    Windows XP mode - 7: how to get the Realtek Audio Drivers with GS Wavetable outside normal? Instead of RDP Audio driver!

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the Windows Virtual PC and XP Mode Forums.

    http://social.technet.Microsoft.com/forums/en-us/w7itprovirt/threads

  • How to get the free license for HP Custom Image for ESXi 5.1.0

    Hi there guys.

    I have HP Proliant DL160 G6 and I installed this: https://my.vmware.com/group/vmware/details?downloadGroup=HP-ESXI-5.1.0U3-GA & productId = 285

    I would like to ask how I can get a free license for this hypervisor?

    My server supports only hypervisor 5.1, but none of the most recent versions, then told me to install the one I posted above.

    This version of the free hypervisor and how do I get the license for this last, or where I can download another more recent free hypervisor can 5.1.0?

    Thanks in advance!

    Unfortunately, you can't have the old version free license... As if you were going to a free version, you can try the latest version and key are available with them. Currently esxi 6.0.

    If you bought the license for 5.1, then you can get the license key. another sound impossible.

  • How to get the date for the first Monday of each month

    Dear members,

    How to get the date for the first Monday of each month.

    I wrote the following code

    SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL

    But he looks at complex bith.

    Abhishek

    Published by: 9999999 on 8 March 2013 04:30

    Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:

    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    /
    
    CURRENT_D FIRST_MON
    --------- ---------
    08-MAR-13 04-MAR-13
    
    SQL> 
    

    Here is the list of the first Monday of the month of this year:

    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
             )
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    /
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-DEC-13 02-DEC-13
    
    12 rows selected.
    
    SQL> 
    

    SY.

Maybe you are looking for

  • I can't open a section of cPanel for Awstats

    I use Mozilla Firefox, BUT all programs work properly with the exception of Awstats, which, once opened, all I get is all data and information on the left side of the page and I can't open any program.Any suggestions will be greatly appreciated. Than

  • Satellite M40X - BSOD caused by ATI2DVAG. Win XP SP3 DLL

    Hello I have a laptop Tosiba Satellite M40X. When the ATI display driver is installed, there is a blue screen caused by a loop of infitive caused by the ATI2DVAG. DLL with the OEM Version of Windows XP, the machine is working no more. When a full Win

  • pouches &amp; ID tag with e260 problem

    Can anyone help with these 2 problems: Every album I put on the e260 has 1 album art, with a few albums, they are displayed with the other not? I changed the album art for another with a different size, but nothing works. The album art is in the righ

  • HP-envy-17-j141na

    Hello I have a few questions on a laptop, I think of buying, so all the answers would be great. This is the laptop: http://store.HP.com/UKStore/merch/product.aspx?ID=J0C16EA&opt=Abu&SEL=PCNB#merch-customer-reviews It's apparently only a computer port

  • Correct procedure to upload photos, the disc

    I have trouble downloading my pictures from my sand drive to my pc. What I am doing wrong?