Equivalent Function in BI for "Next_day"

Hi Experts,
I am working on ORACLE database...
In one of my logical column ... i need to use... next_day function.
I can't use.. variable because, it holds only single value.. but my situation here is ... it has to populate with the values based on the parameter (i.e. one of physical column) giving..
Foe Ex: ... *Next_day( Date column , 'SUN')*
Here Date column is one of physical column..
I am interested to know that how do we achieve this in rpd by using our rpd Calendar Date/Time Functions ?
Thanks & Regards
Kishore Guggilla
Edited by: Kishore Guggilla on Nov 25, 2008 6:49 PM
Edited by: Kishore Guggilla on Nov 25, 2008 7:14 PM

Hi Naresh,,
It's okay.. but i don't want 7... there...
Please read my post completely...
And also without hard coding... i want.. please
Thanks & Regards
Kishore Guggilla
Edited by: Kishore Guggilla on Nov 25, 2008 7:18 PM

Similar Messages

  • Equivalent function for box3d which available in Postgis

    I have a road_network data I am trying to
    obtain all the values within a bounding box formed by lat long values,
    i tried below example but it compiled and produces some error 
    declare @exmp varchar;
    set @exmp = 'POLYGON(81.959545899804 25.243612186501,81.985879306176 25.2726072490010)'
    DECLARE @box geography = geography::STLineFromText(@exmp, 4326)
    SELECT source,target,geog4326.STAsText()
    FROM road_network
    WHERE geog4326.STIntersects(@box) = 1;
    in PostGIS theres a box3d, i like to know is there any equivalent function available in MS SQL Server ?

    a few problems here:
    1.
    run this- what do you see?
    declare @exmp varchar;
    set @exmp
    = 'POLYGON(81.959545899804 25.243612186501,81.985879306176 25.2726072490010)'
    print @exmp
    a varchar initialised without a size defaults to varchar(1)
    so set varchar to the required value or set it to varchar(max)
    2. A polygon requires at least 3 distinct points and the start and end points need to be the same. I'm assuming you just want to draw a line between the 1st & 3rd points of your bounding box and have the db engine draw the box around them. So you should
    be declaring it as a LINESTRING, not a polygon. Unfortunately geography doesn't have a .STEnvelope() function, so you'll need to convert the line to geometry, get the envelope, then convert back
    declare @exmp varchar(max);
    set @exmp = 'LINESTRING(81.959545899804 25.243612186501, 81.985879306176 25.2726072490010)'
    DECLARE @box geography = geography::STLineFromText(@exmp, 4326)
    -- Work out bounding box by converting to geometry via WKB, then using STEnvelope()
    DECLARE @boundingbox geometry = geometry::STGeomFromWKB(@box.STAsBinary(), @box.STSrid).STEnvelope();
    -- Convert result back to geography via WKB
    SET @box = geography::STGeomFromWKB(@boundingbox.STAsBinary(), @boundingbox.STSrid);
    (from
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/453d2fe8-bbe6-4047-90ce-556015c17e64/how-to-get-the-bounding-rectangle-of-a-geography)
    now you can intersect your @box.
    If this were geometry you could've just used .STFilter() on your linestring directly.. I'm not sure how .Filter() works with geography but investigate it as it'll be faster if your road_network table has correct spatial indexes.
    Jakub @ Adelaide, Australia

  • @RELATIVE() equivalent function in Financial Reporting Studio?

    All,
    Is there an FR equivalent function to the @RELATIVE() function in Essbase?
    Specifically, I'm trying to select Level 0 descendants of a particular member.
    e.g. @RELATIVE(MEMBER,0) would be the equivalent function in Essbase.
    I've tried to use the RelativeMember function, but that does not appear to do the same thing.
    I also tried to union two selections, but that just returns an MDX error.
    e.g. assume I want to return child 2 and 3
    Dimension
    Parent A
    Child 1
    Parent B
    Child 2
    Child 3
    Lev0,Dimension NOT Descendant Parent A (this is not the actual syntax, but an explanation of what I tried). This returns an MDX error to do with "NOT".
    Any help is appreciated...

    That was extremely helpful. I was able to get it working with the following syntax
    Descendants of <Member> AND System-defined member list Lev0,<Dimension>
    Thanks again for your help.

  • What is the equivalent function of NIDAQYield in NI-DAQmx?

    I have to migrate from traditional NI-DAQ to NI-DAQmx for Window 7 64bits system.  I like to find the equivalent function of NIDAQYield in NI-DAQmx?

    As far as I can see here, NIDAQYield is simply a way to process system events, so I suppose calling ProcessSystemEvents () will be equivalent to calling it.I do not know of a native DAQmx function that does the same. It is to be said, though, that DAQmx way of handling acquisition process is different from Traditional DAQ one and direct translation is not always possible, so depending on how you migrate your code, calling those functions may be unnecessary.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • "Extract" filter or equivalent function

    Where do I find the "Extract" filter or equivalent function found on earlier versions of Photoshop?

    Norm, you'll have noticed the video is one of those super easy images they used to demo Refine Edge when it was first available?  I struggled with the tool for ages back then, finding a far from intuitive tool to use in real world situations, which is why I often use the Martin Evening tutorial on this forum, because he demos a difficult image, plus he shows how best you use it in the target image.  But I decided to make it look easy in my post above

  • Java Equivalent Function to Obfuscation DES3 Procedures

    I've read all of the notes and reports that I could find on both OTN and MetaLink, but I can't find a solution anywhere. Just hints, particularly in Note 232000.1 and Note 225214.1. I've been trying all of the variations that I can think of in test code with no success. I've also searched the net extensively.
    What I need is a code sample IN JAVA that provides equivalent functionality to the des3encrypt and des3decrypt procedures using raw values in the obfuscation toolkit.
    We have a number of huge databases in which we would like to use the obfuscation toolkit with DES3 3-key (192-bit) keys to manage encrypting
    confidential data. We need to be able to read this data from Java applications. Those applications must be able to decrypt the values encrypted using the toolkit. We must also be able to do the reverse, encrypt data in Java, store the encrypted values, the decrypt and access the data in PL/SQL using the toolkit.
    I've searched high and low, but I cannot find sample code anywhere for performing this functionality in an equivalent fashion.
    Thanks!
    Mark Scarton
    [email protected]

    Hi Mark,
    I encountered a similar challenge, were you able to figure out the solution for this problem?
    Thanks,
    Srikanth

  • Is there an equivalent statement in Java for this PL/SQL stmt?

    Hi,
    I want to know if there is an equivalent statement
    in java for this PL/SQL statement:
    IF strTok IN('COM-1','COM-2','COM-3') Then
    /* Do Something */
    End If;
    I tried using : // This is giving me errors..
    if (strTok.equals(("COM-1") || ("COM-2") || ("COM-3") ) )
    /* Do Something */
    The above Java code is giving me errors.
    Any Help to reduce the number of steps for comparison
    is appreciated.
    thanks in adv
    Sharath

    Something like
    if (strTok.equals("COM-1") ||
        strTok.equals("COM-2") ||
        strTok.equals("COM-3") )Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to use the functionality of Simulation for the Transaction MIRO

    Hi Group,
    I have a requirement to call SAP from MS Excel and check for the SImulation option as under:
    The Excel will pass the values of Invoice Number, Posting date, PO number, PO Item number, Company code and etc., through the call of BAPI   -   'BAPI_INCOMINGINVOICE_CREATE'  in order to create Invoice in the SAP system.
    But the above BAPI is creating the Invoices in SAP system. Rather, I need to just check(thru SIMULATION) the records and come back to MS Excel with the MIRO numbers that will be created and the errror messages that will be returned back.
    In summary, I have to add two Buttons as:
       POST : this has to create MIRO(invoice Numbers) in the SAP System(populating the Success/Error Messages by calling
                   the above BAPI   -  This functionality is working fine now
       SIMULATE: this has to do  same functionality of "POST" option but should not create MIROs in the SAP system
                          Currently I am not able to achieve this as the above BAPI is creating MIROs in SAP.
    Kindly provide your inputs on how to go about incorporating the above SIMULATION functionality, by giving some simulation BAPIs that can be used for my functionality.
    Thanks for your help in advance.
    Regards,
    Vishnu.

    Hi Group,
    In continuation to my previous posting, I would like to give more inputs as under:
    when I was using the BAPI - BAPI_INCOMINGINVOICE_CREATE (unless I commit the transaction), MIRO would not be created in the system.
    Now, when I run the BAPI again with a different set of data, the Invoice Number is getting incremented by one.... this I dont need, if the Invoice is not committed and if I run the next time, I need to get the same Invoice Number....
    How can I achieve this task?
    Kindly let me know your inputs on this.
    Regards,
    Vishnu.

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • [8i] Help with function with parameters (for workday calculation)

    Let me start by saying, I've never written a function before, and I don't have access to create a function in my database (i.e. I can't test this function). I'm trying to come up with a function that I can ask my IT department to add for me. I'm hoping someone can take a look at what I've written and tell me if it should work or not, and if this is the right way to go about solving my problem.
    I am trying to create a function to do a very simple workday calculation (adding/subtracting a particular number of workdays from a calendar date).
    The database I'm working with has a table with the workday calendar in it. Here is a sample table and sample data, representative of what's in my workday calendar table:
    CREATE TABLE caln
    (     clndr_dt     DATE,
         shop_days     NUMBER(5)
         CONSTRAINT caln_pk PRIMARY KEY (clndr_dt)
    INSERT INTO     caln
    VALUES (To_Date('01/01/1980','mm/dd/yyyy'),0);
    INSERT INTO     caln
    VALUES (To_Date('01/02/1980','mm/dd/yyyy'),1);
    INSERT INTO     caln
    VALUES (To_Date('01/03/1980','mm/dd/yyyy'),2);
    INSERT INTO     caln
    VALUES (To_Date('01/04/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/05/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/06/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/07/1980','mm/dd/yyyy'),4);
    INSERT INTO     caln
    VALUES (To_Date('01/08/1980','mm/dd/yyyy'),5);
    INSERT INTO     caln
    VALUES (To_Date('01/09/1980','mm/dd/yyyy'),6);
    INSERT INTO     caln
    VALUES (To_Date('01/10/1980','mm/dd/yyyy'),7);
    INSERT INTO     caln
    VALUES (To_Date('01/11/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/12/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/13/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/14/1980','mm/dd/yyyy'),9);The actual table includes from 1/1/1980 though 12/31/2015.
    I've written (and validated) this parameter query which does my workday (mday) calculation:
    SELECT     cal.clndr_dt
    FROM     CALN cal
         SELECT     cal.shop_days+:mdays     AS new_shop_days
         FROM     CALN cal
         WHERE     cal.clndr_dt     =:start_date
         ) a
    WHERE     cal.shop_days     = a.new_shop_days
    AND     ROWNUM          =1
    ORDER BY     cal.clndr_dt;Based on this query, I've created the following function (and I have no clue if it works or if the syntax is right, etc.):
    CREATE OR REPLACE FUNCTION add_mdays
         (start_date     IN DATE,
         mdays          IN NUMBER(5))
    RETURN     DATE
    IS
         new_date DATE;
    BEGIN
         SELECT     cal.clndr_dt
         FROM     CALN cal
              SELECT     cal.shop_days+mdays     AS new_shop_days
              FROM     CALN cal
              WHERE     cal.clndr_dt     =start_date
              ) a
         WHERE     cal.shop_days     = a.new_shop_days
         AND     ROWNUM          =1
         ORDER BY     cal.clndr_dt;
         RETURN     new_date;
    END add_mdays;  //edit 9:31 AM - noticed I left off this bitI'm also not sure how to have the function handle results that would return a date outside of the date range that is in the table (Before 1/1/1980 or after 12/31/2015--or, another way to look at it is, before the MIN value of caln.clndr_dt or after the MAX value of caln.clndr_dt).
    My goal is to be able to use the function in a situation like the following:
    First, here's a sample table and data:
    CREATE TABLE orders
    (     ord_no          NUMBER(5),
         plan_start_dt     DATE,
         CONSTRAINT orders_pk PRIMARY KEY (ord_no)
    INSERT INTO orders
    VALUES (1,To_Date('01/08/1980','mm/dd/yyyy'));
    INSERT INTO orders
    VALUES (2,To_Date('01/09/1980','mm/dd/yyyy'));
    INSERT INTO orders
    VALUES (3,To_Date('01/10/1980','mm/dd/yyyy'));And here is how I would like to use my function:
    SELECT     orders.ord_no
    ,     orders.plan_start_dt
    ,     add_mdays(orders.plan_start_dt, -3) AS prep_date
    FROM     ordersThus, the function would allow me to return, for every order in my orders table, the date that is 3 workdays (mdays) prior to the plan start date of each order.
    Am I going about this the right way? Do I need to create a function to do this, or is there a way for me to incorporate my query (that does my mday calculation) into the sample query above (eliminating the need to create a function)?
    Thanks much in advance!
    Edited by: user11033437 on Feb 2, 2010 8:55 AM
    Fixed a couple typos in the last insert statements
    Edited by: user11033437 on Feb 2, 2010 9:31 AM (fixed some syntax in the function)

    Hi,
    Ah, mentioning Oracle 8 and not being able to test your own code makes me nostalgic for the good old days, when you typed your cards, and brought them to a window at the computer center, and waited an hour for the job to run, and then saw the printout to find that you had made a typo.
    If you're going to write functions, you really need to test them yourself. Like all code, functions whould be written in baby steps: write a line or two (or sometimes just part of what will later become one line), test, make sure it's running correctly, and repeat.
    Ideally, your employer should create a developement schema in a development database for you to use.
    You can legally download your own instance of Oracle Express Edition for free; just be careful not to use features that aren't available in the database where the code will be deployed.
    You don't need a function to get the results you want:
    SELECT       o.ord_no
    ,       o.plan_start_dt
    ,       MIN (e.clndr_dt)     AS prep_date
    FROM       orders     o
    ,       caln          l
    ,       caln          e
    WHERE       l.clndr_dt     = o.plan_start_dt
    AND       e.shop_days     = l.shop_days - 3
    GROUP BY  o.ord_no
    ,            o.plan_start_dt
    ;This would be more efficient (and a little simpler) if you added a column (let's call it work_day) that identified if each row represented a work_day or not.
    For each value of shop_days, exactly 1 row will be marked as a work day.
    Then the query might be something like:
    SELECT       o.ord_no
    ,       o.plan_start_dt
    ,       e.clndr_dt          AS prep_date
    FROM       orders     o
    ,       caln          l
    ,       caln          e
    WHERE       l.clndr_dt     = o.plan_start_dt
    AND       e.shop_days     = l.shop_days - 3
    AND       e.work_day     = 1
    ;You could use the analytic LAG function to populate the work_day column.
    A function would certainly be handy, though perhaps slower.
    The function you posted has a few mistakes:
    (a) An argument can't be declared as NUMBER (5); just NUMBER.
    (b) When you SELECT in PL/SQL, like you're doing, you have to SELECT INTO some variable to hold the results.
    (c) ROWNUM is arbitrary (which makes it useless in this problem) unless you are drawing from an ordered sub-query. I don't think you can use ORDER BY in sub-queries in Oracle 8. Use the analytic ROW_NUMBER function instead.
    (d) The function must end with an END statement.
    Given your current caln table, here's how I would write the function:
    CREATE OR REPLACE FUNCTION add_mdays
         ( start_date     IN           DATE          DEFAULT     SYSDATE,
           mdays          IN           NUMBER          DEFAULT     1
    RETURN     DATE
    DETERMINISTIC
    IS
         --     add_mdays returns the DATE that is mdays working days
         --     after start_date.  (If mdays < 0, the DATE returned
         --     will be before start_date).
         --     Work days do not include Saturdays, Sundays or holidays
         --     as indicated in the caln table.
         new_date     DATE;          -- to be returned
    BEGIN
         SELECT     MIN (t.clndr_dt)
         INTO     new_date
         FROM     caln     f     -- f stands for "from"
         ,     caln     t     -- t stands for "to"
         WHERE     f.clndr_dt     = TRUNC (start_date)
         AND     t.shop_days     = f.shop_days + TRUNC (mdays)
         RETURN     new_date;
    END     add_mdays;
    SHOW ERRORSProduction code whould be robust (that includes "idiot-proofing").
    Try to foresee what errors people might make in calling your function, and correct for them when possible.
    For example, if it only makes sense for start_date to be midnight, or mdays to be an integer, then use TRUNC in the function in case soembody passes a bad value.
    Allow for default arguments.
    Comment your function. Put all comments within the function (that is, after CREATE and before the final END) so that they will be kept in the data dictionary.
    If, given the same arguments, the function always returns the same value, mark it as DETERMINISTIC, for efficiency. This means the system may remember values passed back rather than call the function every time it is told to.
    I wish I could mark questions as "Correct" or "Helpful"; you'd get 10 points for sure.
    You posted CREATE TABLE and INSERT statements (without even being begged).
    You gave a clear description of the problem, including desired results.
    The code is nicely formatted and easy to read.
    All around, one of the most thoughtful, well-written questions I've seen.
    Well done! Keep up the good work!
    Edited by: Frank Kulash on Feb 2, 2010 1:10 PM
    Added my own version of the function.

  • There is no filter function in numbers for ipad,its very discouraging,as a ipad fan,even nokia lumia providing filter in there low cost mobile

    there is no filter function in numbers for ipad,its very discouraging,as a ipad fan,even nokia lumia providing filter function in excel in there low cost mobile.
    APPLE KINDLY PROVIDE THIS FEATURE AS UPDATE SOON,COZ I WORK ON EXCEL N NUMBERS IN MY IPAD IS DEAD WITH OUT FILTER FUNCTION,I CAN NOT TRAVEL WITH MY IPAD DUE TO THIS REASON,AS I HAVE TO BE IN FIELD WITH SALES FORCE SO I BOUGHT IPAD.

    Probably you know that the new version of Numbers for iOS uses the filters created in the Numbers for Mac version.
    It's not the best solution but it helps (of course, if you have a Mac!)

  • Function module exits for Tcode MD11.

    Please tell me, Function module exits for Tcode MD11.
    Reg .
    Praju

    Hi
    LMDR2001
    LMDZU001
    Try out these exits.
    Check the folloing BADI's
    MD_PLDORD_SCHEDULING
    MD_PIR_FLEX_CONS
    MD_PLDORD_SCHEDULING
    Regards
    Divya

  • Function module name for routing fom production orders

    Function module name for routing fom production orders

    Hi
    There are lot of fun modules related to routing
    like
    BAPI_ROUTING_CREATE
    BAPI_ROUTING_EXISTENCE_CHECK
    goto SE37 Tcode
    enter routing press F4
    you will get a lot out of that use the required one
    Reward points for useful Answers
    Regards
    Anji

  • Function Module (BAPI) for Delivery Change

    Dear All,
    We have a Function Module "BAPI_SALESORDER_CHANGE" for changes in sales order, wherein we also can enter Texts in sales order.
    Please tell me similar such function module for Outbound Delivery, wherein I can enter / insert / change the Texts (both Header & Item) in a deivery document.
    Regards,
    Dhananjay

    Thanks
    Where in this Function Module do I find the table / parameter for adding text at item & header level.
    Regards
    Dhananjay

  • Function module need for 0fiscvarnt

    Hi i have 0comp_code,budat and 0fiscper as a source fields,now i want to get 0fiscvarnt...please give me any logic or function module available for that
    thanks

    Hi,
    Usually fiscal year variant is constant if not getting populated from source system.
    Check with function team member what Fiscal year variant they using.
    Regards,
    Akshay

Maybe you are looking for