Make a date calculation within nested in BI Publiser ifs

Hello.

Asked me to convert all of our Crystal reports that are used for BI Publisher, in preparation for moving to 9.2 PeopleSoft. My problem is that my expertise lies more with Crystal BI Publisher.

My problem is that I do a conditional calculation to get the number of days, that someone was on a claim. Crystal the formula looks like this:

in the case of CONTRARY ISNULL ({COL_CLAIMS_OUTSTANDING1. COL_CLM_1ST_DY_UBL}) then

If ISNULL ({COL_CLAIMS_OUTSTANDING1. COL_CLM_COMPLETE}) then

DateDiff ("d", {COL_CLAIMS_OUTSTANDING1. (COL_CLM_1ST_DY_UBL}, today)

on the other

DateDiff ("d", {COL_CLAIMS_OUTSTANDING1. COL_CLM_1ST_DY_UBL}, {COL_CLAIMS_OUTSTANDING1. COL_CLM_COMPLETE}

I have some code obtained from other parts of the forum and has managed to ride with singleton instructions that work. For example:

<? xdofx:round ((to_number (to_char (SYSDATE, 'JSSSSS')) - to_number (to_char (to_date (A.FIRST_DAY_UNABLE, 'YYYY-MM-DD'), 'JSSSSS'))) div 100000)? >


But when I try to make the nested conditional so I don't get no return what so ever and I have no idea what I'm missing (even though I'm pretty sure that it will cause slap me my forehead and say "DOH"):

<? xdofx:A.FIRST_DAY_UNABLE! = "then

If A.CLAIM_COMPLETE = "then

Round ((TO_NUMBER (to_char (sysdate, 'JSSSSS')) - to_number (to_char (to_date (A.FIRST_DAY_UNABLE, 'YYYY-MM-DD'), 'JSSSSS'))) div 100000)

on the other

Round ((TO_NUMBER (to_char (A.CLAIM_COMPLETE, 'JSSSSS')) - to_number (to_char (to_date (A.FIRST_DAY_UNABLE, 'YYYY-MM-DD'), 'JSSSSS'))) div 100000)

end if? >

Thank you... I was able to understand it and fixed by the following:

If A.CLAIM_COMPLETE = "then

Round ((TO_NUMBER (to_char (sysdate, 'JSSSSS')) - to_number (to_char (to_date (A.FIRST_DAY_UNABLE, 'YYYY-MM-DD'), 'JSSSSS'))) div 100000)

on the other

Round ((TO_NUMBER (to_char (A.CLAIM_COMPLETE, 'JSSSSS')) - to_number (to_char (to_date (A.FIRST_DAY_UNABLE, 'YYYY-MM-DD'), 'JSSSSS'))) div 100000)

end if? >

Tags: Oracle Applications

Similar Questions

  • How do I load the data calculated in HFM

    Hi gurus

    1. how to load the data calculated in HFM?

    I extracted the calculated data and when I tried to load the data calculated in HFM is partially responsible, showing the errors you can not load data for parent members of the account, Custom personalized 1 4...
    Then I ran the consolidation to get the values of the parent company.
    Is there an alternative way to load the data calculated in HFM?

    Concerning
    Hubin

    Hi Hubin,

    Calculated data cannot be loaded in HFM manually, these accounts with calculated field data should be generated through the logic of the computation.

    And parent members also don't take the data they are parents for the sum of some basic level accounts.

    So just load the data for basic level accounts and make sure they are consolidated accounts of field, that there was no error and calculated accounts data automatically generates through the logic written in the Rules file.

    And after loading data just run the consolidation and sink also rules file in both cases to the work of the logic of the computation.

    Kind regards
    Srikanth

  • Problems with date calculation

    I have a java (and much more far vb) background and it seems that I'm really dependent functions for date calculations.  I'm trying to do a few things, but have not been able to accomplish them.

    I do not have

    Calendar.add()
    

    I briefly contemplated an add function by converting into long then do the calculation and returns a new calendar object, but the problems with this approach comes flourishes as soon as I started.  Just trying to find out if a date was yesterday was me banging my head against the wall.

    Any help please?

    I wrote this, but I don't know if there is a simpler method, go to this issue the wrong way, etc.

    public static boolean isYesterday(Calendar c) {
        Calendar today = Calendar.getInstance();
        int newDay = today.get(Calendar.DAY_OF_MONTH);
        if (newDay == 1) { //get last day of previous month
            int newMonth = today.get(Calendar.MONTH);
            int newYear = today.get(Calendar.YEAR);
            /* If jan 1, get dec of last year */
            if (newMonth == 0) { //Java Calendar.MONTH is zero-based
                newMonth = 11;
                newYear -= 1;
            today.set(Calendar.YEAR, newYear);
            }
            today.set(Calendar.MONTH, newMonth);
            newDay = DateTimeUtilities.getNumberOfDaysInMonth(newMonth, newYear);
        } else {
            newDay -= 1;
        }
        today.set(Calendar.DAY_OF_MONTH, newDay);
        return DateTimeUtilities.isSameDate(today.getTime().getTime(), c.getTime().getTime());
    }
    

    'convert to tz to the device.

    I recommend that stick you with using UTC for everything.  If you want to display to the user, then a DateField will convert the hour UTC to local time.  SImpleDateFormat.formatLocal will also print you long time UTC to local time.  So I recommend that you do not have to convert once at the local level.

    Remember that System.currentTimeMillis () is time not UTC/GMT.

    Of course, that's a good advice or not depends on your app.

    I'm not aware of any third-party code that helps, I reinvented wheels square to all my treatment to date.  But I never really looked at.

    About your code, assuming that c calendar uses the local time zone, so I think that the code works.

  • How to make uneditable Date field in ADF

    Hello

    I use Jdev 11.1.1.7.1.

    In the fragment, I added the DATE of the ENTRY component. How to make uneditable date field. He should just take the input value of the grille.

    Kindly advice me.

    Thank you

    Swathi

    Your date. MinValue must be like this:

    
                
                
                  
              
    
  • I can't make a new collection within a collection.

    I can't make a new collection within a collection. LR recognize only a witch five collection I did at the beginning of the use of LR

    You must first do a defined Collection and then create collections it contains.

  • cannot select data in a nested table?

    why we cannot select data in a nested table?

    DECLARE
        TYPE MY_ARR IS TABLE OF VARCHAR2(15);
        IDArr MY_ARR;
    BEGIN  
        IDArr := MY_ARR();
        select ename into IDArr from emp;
    END;
    /

    806540 wrote:
    why we cannot select data in a nested table?

    DECLARE
    TYPE MY_ARR IS TABLE OF VARCHAR2(15);
    IDArr MY_ARR;
    BEGIN
    IDArr := MY_ARR();
    select ename into IDArr from emp;
    END;
    /
    

    It also isn't a such thing as a ' + nested table + "-despite what the documentation calls them. The CORRECT term is the table. Since the dawn of programming. And called 'paintings' in many languages of programming and data structure theory ever since.

    In Oracle, the term "table" has a very precise meaning. A table in PL/SQL language nothing BUT a table at all. A completely different data structure that does not have the characteristics of an Oracle table.

    The code you wrote is also dangerous. If there are 100,000 rows in this table, you will copy all 100,000 rows in a PL/SQL table - that resides in the memory of the very expensive server called the PGA (process private memory). You can cause a serious impact on the memory of the server with this approach of poor quality - I saw such a code crashing the production servers.

    So let's not terminology. Is the wrong approach. Code is wrong.

    So why not rather tell us what you're doing, or trying to understand, instead?

  • Help with date calculation

    Need help to calculate a future date.  Right now I have it where he Calc. 25 days in the future.  But need 25 working days in the future.

    Form1. Page1.Button1::click - (JavaScript, client)

    var oNow = new Date();
    Add 25 days and subject to the new date
    oNow = new Date (oNow.getFullYear (), oNow.getMonth (), (oNow.getDate () + 25))
    view the new date information
    sMsg = "in 25 days, it will be" + util.printd ("mm/dd/yyyy", oNow);
    sMsg += "\n" + "the day of the week will be" + util.printd ("dddd", oNow);
    App.Alert (sMsg, 3, 0)

    Hello

    I have not tried this, but it should be close:

    var oNow = new Date();
    var oDay = util.printd("dddd", oNow);
    // add 25 working days and make new date object
    if (oNow == "Saturday")
    {
         oNow = new Date(oNow.getFullYear(), oNow.getMonth(), (oNow.getDate() + 35 + 2));
    }
    else if (oNow == "Sunday")
    {
         oNow = new Date(oNow.getFullYear(), oNow.getMonth(), (oNow.getDate() + 35 + 1));
    }
    else
    {
         oNow = new Date(oNow.getFullYear(), oNow.getMonth(), (oNow.getDate() + 35));
    }
    // dispaly new date information
    sMsg = "In 25 working days it will be " + util.printd("mm/dd/yyyy", oNow);
    sMsg += "\n" + "The day of the week will be " + util.printd("dddd", oNow);
    app.alert(sMsg, 3, 0);
    

    The 35 is seven days for each of the 5-day work weeks. The + 2 and + 1 grow a weekend in the next business day.

    Hope that works,

    Niall

    Ensure the dynamics

  • Make the date picker opened when the user navigates to the date field

    Hi people.

    Anyone know if it's possible to make a date picker open as soon as a user clicks or tabs on a date field?

    Answers on a postcard / response received with gratitude.

    Kind regards

    Simon Gadd

    Hi Simon,.

    I think I have the answer now.

    In your area header area, add in the following:

    <script type="text/javascript">
    var ok = 1;
    function showDatepicker()
    {
     if (ok == 1)
     {
      ok = 0;
      document.getElementById('P5_DATE_IMG').click();
     }
    }
    function resetDatepicker()
    {
     ok = 1;
    }
    </script>
    

    and as attributes of the element Form HTML of the element of your date, add in:

    onfocus="javascript:showDatepicker();" onblur="javascript:resetDatepicker();"
    

    This means that your article is called P5_DATE - change according to the case.

    Andy

  • extract data within nested namespaces

    Hello! I have an xml that loos like this:

    create table mytable (id number, donnees_xml xmltype);

    insert into mytable values
    (1, xmltype ("< ndl:daily - connect you xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"xmlns:ndl =" http://myurl/API">))
    < apt: Airport xmlns: apt = "http://myurl/API/apt" >
    < Apt_ID > CBA < / Apt_ID >
    AR < of State > < / State >
    < track >
    < Rwy_ID > 01 < / Rwy_ID >
    < Rwy_ID > 02 < / Rwy_ID >
    < / tracks >
    < / apt: Airport >
    < apt: Airport xmlns: apt = "http://myurl/API/apt" >
    < Apt_ID > XYZ < / Apt_ID >
    AK < of State > < / State >
    < track >
    < Rwy_ID > 36 < / Rwy_ID >
    < Rwy_ID > 18 < / Rwy_ID >
    < / tracks >
    < / apt: Airport >
    ((< / ndl:daily - Journal > '));

    commit;

    I'm trying to use extractvalue function to get data in Apt_ID and Rwy_ID, but continue to make a mistake ' * ORA-19025: EXTRACTVALUE returns the value of a single node. " To avoid the error ORA-19025 I need to specify a nonrepeating node which is the < ndl:daily - Journal > but I don't know if it is possible to specify several namespaces in the EXTRACT function. Anyone know? I tried something like this but this is not correct.

    1 Select
    2 extractValue (value (x), ' / / Apt_ID') Apt_ID,.
    3 extractValue (value (x), ' / / tracks/Rwy_ID ') Rwy_Id
    4 from myTable,
    Table 5 (xmlsequence (extract (donnees_xml,'/ / ndl:daily - log/apt: Airport ',)))
    6 * ' xmlns:ndl = "http://myurl/API" xmlns: = 'http://myurl/API/apt' apt '))) x
    SQL > /.
    Select
    *
    ERROR on line 1:
    ORA-19025: EXTRACTVALUE returns the value of a single node
    select extractValue(value(x), '//Apt_ID') Apt_ID
    , extractValue(value(y), '.') Rwy_Id
    from table(xmlsequence(extract(
    xmltype('
    
    ABC
    AR
    
    01
    02
    
    
    
    XYZ
    AK
    
    36
    18
    
    
    ')
    ,'//ndl:daily-log/apt:Airport','xmlns:ndl="http://myurl/API" xmlns:apt="http://myurl/API/apt"'))) x
    , table( xmlsequence( extract( value( x ), '//Runways/Rwy_ID' ) ) ) y
    
  • Inserting data in the nested table

    I explore the differences between the OBJECT and RECORD.

    As I'm still learning, I found that both are structures which essentially brings together different elements of types of different data or columns of data types, one is used in SQL and other is used in PL/SQL, please correct me if I'm wrong in my understanding.

    Below, I am trying to insert data into an array of type object, but I can't can you please help.

    CREATE OR REPLACE type sam as OBJECT
    (
    v1 NUMBER,
    v2 VARCHAR2(20 CHAR)
    );
    
    ---Nested Table---
    create or replace type t_sam as table of sam;
    
    --Inserting data----
    insert into table(t_sam) values(sam(10,'Dsouza'));
    

    Error message:

    Error starting at line 22 in command:
    insert into table(t_sam) values(sam(10,'Dsouza'))
    Error at Command Line:22 Column:13
    Error report:
    SQL Error: ORA-00903: invalid table name
    00903. 00000 -  "invalid table name"
    *Cause:    
    *Action:
    

    Ariean wrote:

    So the only purpose of the equivalent concept of SQL types of nested tables is to use one of the data types when you define an actual table?

    So-you can certainly use more that a simple "set an actual table. (I'm fairly certain that you can pass a table nested within a procedure, for example - try it, though - I'm not 100% sure on that - it just 'logic'.) If you can define a type, you can use it, pass it around, whatever.).

    Ariean wrote:

    And this nested table could be a record in SQL or object in PLSQL or simple data type (varchar number, etc.)?

    Nested tables are just like any other type of custom data. You can create a nested table of other types of data. You can create a custom of nested tables data type.

    Stupidly, he could become... uh, stupid O_0

    CREATE TYPE o_myobj1 AS object ( id1   number, cdate1  date );
    
    CREATE TYPE t_mytype1 AS table of o_myobj1;
    
    CREATE TYPE o_myobj2 AS object ( id2   number,  dumb  t_mytype1 );
    
    CREATE TYPE t_dumber AS table of o_myobj2;
    

    O_0

    OK, my brain is starting to hurt - I hope you get the idea

    Ariean wrote:

    Second is my understanding correct any OBJECT & RECORD?

    I see no benefit to describe another way.

  • Analyze the flat file data in a nested structure.

    This has been driving me crazy all day long.

    I have a flat data file I want to analyze in a nested data structure.

    Small sample data:

    0 HEAD
    1 SOUR FTW
    2 VERS Family Tree Maker (16.0.350)
    2 NAME Family Tree Maker for Windows
    2 CORP MyFamily.com, Inc.
    3 ADDR 360 W 4800 N
    4 CONT Provo, UT 84604
    3 PHON (801) 705-7000
    0 TRLR
    

    If anyone recognizes this, yes it's a small piece of a GEDCOM file.  That's what I'm trying to analyze.  For someone who is not familiar with this data format.  The first number is the level of a data element.  Level 0 are elements of the root of a data segment.  Level 1 lines relate to the data of level 0 line previous closest.  Level 2 lines relate to the level 1 data line that precedes the closest. And so on.

    Here is an example of the desired output, the different elements to the related parent of nesting.

    <cfset foobar = {
     HEAD = {lvl=0,
     SOUR = {lvl=1,data="FTW",
     VERS = {lvl=2,data="Family Tree Maker (16.0.350)"},
     NAME = {lvl=2,data="Family Tree Maker for Windows"},
     CORP = {lvl=2,data="MyFamily.com, Inc.",
     ADDR = {lvl=3,data="360 W 4800 N",
     CONT = {lvl=4,data="Provo, UT 84604"}},
     PHON = {lvl=3,data="(801) 705-7000"}}}},
     TRLR = {lvl=0}
    }>
    
    <cfdump var="#foobar#">
    

    I think I'm looking at a kind of recursive function to embed these data correctly, but I just can't figure out how to do.

    I have this basic function that will display each line of data in a separate structure key

    <cffunction name="parseFile">
         <cfargument name="file" required="yes">
         <cfargument name="line" required="no" type="string" default="">
         
         <cfscript>
              var returnStruct = structNew();
              var subStruct = structNew();
              var cur_line = "";
              var next_line = "";
              var line_lvl = "";
              var line_key = "";
              var loop = true;
              
              if (len(trim(arguments.line)) EQ 0) {
                   cur_line = fileReadLine(arguments.file);
              }
              else
              {
                   cur_line = arguments.line;
              }
              
              do {
                   if (not FileISEOF(arguments.file)) {
                        next_line = fileReadLine(arguments.file);
                   }
                   else
                   {
                        next_line = "-1";
                        loop = false;
                   }
                   
                   line_lvl = listFirst(cur_line, ' ');
                   cur_line = listRest(cur_line, ' ');
                   line_key = listFirst(cur_line, ' ');
                   cur_line = listRest(cur_line, ' ');
                   
                   returnStruct[line_key] = structNew();
                   returnStruct[line_key]["level"] = line_lvl;
    
                   cur_line = next_line;
              } while (loop);
              
              return returnStruct;
         </cfscript>
    </cffunction>
    
    <cfscript>
         gedcom_file = FileOpen(getDirectoryFromPath(getCurrentTemplatePath()) & "Ian Skinner.GED","read");
         /*gedcom_data = {individuals = structNew(),
                        families = structNew(),
                                             sources = structNew(), 
                                             notes = structNew()};*/
                                             
         gedcom_data = parseFile(gedcom_file);
    </cfscript>
    
    <cfdump var="#gedcom_data#" label="Final Output">
    

    I tried many ways to recursively call this function in order to nest the elements.  None of them have produced await in the above example of hand coded output.  Which made me the closest is recursive call, the function parseFile() towards the end of the while loop if the following line is greater than the current level of line:

    if (listFirst(next_line,' ') GT line_lvl) {
         parseFile(arguments.file,next_line);
    }
    


    It works pretty well, as long as the next level of line is the same as or higher than its previous level of the line.  But once the next line level is lower, the recursive call will not return to the appropriate parent level.  The current function call ends just on a loop on the data file.  Everything that I tried to provide a correct output for recursive function calls when the next data line belongs to a line parent just a horribly distorted data.

    Yes, that's exactly it. I think that the node must always be added to the stack.

    I just had a period gave me. But that's what I thought.

    That is to say...

    While (not FileISEOF (gedcom_file)) {}

    line = fileReadLine (gedcom_file);

    extract data from the node

    node = {};

    node.LVL = listFirst (line, "");

    line = listRest (line, "");

    key = listFirst (line, "");

    If (listLen (line, "") gt 1) {}

    node. Data = listRest (line, "");

    }

    Download the most recent ancestor of the battery

    lastNode = stack [1];

    If it is a brother/ancestor, look for its parent

    While (arrayLen (stack) & node.lvl lte lastNode.lvl) {}

    arrayDeleteAt (battery, 1);

    lastNode = stack [1];

    }

    Add to the stack

    arrayPrepend (stack, node);

    Add this node from its parent

    lastNode [key] = node;

    }

  • LiveCycle incorrect Date calculation?

    I have a couple of areas of a form that copy the following code:

    DateTimeField2.rawValue = Num2Date (Date2Num (xfa.event.newText, ' DD/MM/YYYY "" ") + 30," MM/DD/YYYY");

    Essentially allows you to choose a date that determines a later date of 30 days from the date you have chosen. Sound simple enough however the calculated date is always disabled? So if I take the 2010-07-01 he picks on 31/07/2010, if I choose on 01/02/2010, he chooses 03/03/2010.

    I'm totally stumped as to why this happens, and I am against a wall to make it work. Does anyone have any suggestions?

    Date2Num function converts the date in number. It is then add 30 to the number and then by converting the number back to this day.

    During this process, it does not intend to include the selected date. So in your case, if you want to have the exact 30 days including the selected date, then try adding only 29 instead of 30.

    I hope this helps...

    Thank you

    Srini

  • How to make a data form?

    I am trying to add a 'Form' data entry for a spreadsheet on my Mac. I found that there is an 'X' which led to a compound shape fields on a spreadsheet on my iPad.  Is there such a thing on the Mac version of numbers?

    No, the numbers for the Mac currently have no forms.  I think that thinking must be that they are less needed on a larger screen.  You can make a suggestion via numbers > provide comments numbers in your menu.

    SG

  • How can I save machine vision data calculated?

    Hello everyone,

    I developed a machine vision vbai file to detect the edge of a droplet and calculate the radius of the drop. However, I would like to save the data of droplets of RADIUS in a file so that I can follow the distributions of droplets at the time RADIUS and see it in excel for example.

    However, in the range of functions of industrial vision I see not all save data option and so I transferred the code in a labview VI hoping to get more options. When I opened this VI, I can't really find out where my calculated data are, and I can't also manage store data anyway.

    I'll post the Labview VI and VBAI files and hope someone can tell me how I can save the droplet radius size because I'm kinda a noob in programming Labview.

    Thanks in advance Schoonen Jan-Willem

    Hi René,.

    It worked, thank you very much!

  • How to make the data previously generated reuse vi?

    Attached VI is just a simple example for my problem. I want to generate some data (or read it thanks to a shared variable, etc, etc) and create statistics on these data. In this example, a histogram and value medium.

    Now, if I stop the VI & restart again, the first time that I generate a new data point, all old data is deleted the chart and indicators. I want to change my program, so he'll see actually yet all the data I have accumulated before the table.

    I know how to do for example in matlab:

    output = myfunction (output)

    so when I call this function, the first 'myfunction()' time it will generate the output array I can then move again on the next call so that the previously generated data will be used.

    So, how do I do that in Labview?

    Make a search for globals functional, which is based on the use of a shift register uninitialized for a while loop. You basically already have this if you simply delete the matrix constant which initializes the shift register holding the data table. It is a technique that was used before that global variables have been introduced. It's an old technique, but it is very effective and the basis for the Action engines. Jim Kring suggested a version no.-loop for LabVIEW 8.5.

    Note: You perform a comparison on floating-point values. As noted several times on this forum, it is doomed to failure because of how floating point numbers are stored in computers (this has nothing to do with LabVIEW).

Maybe you are looking for