Calculate fees that pay based on the number of days in a month

Hello

I'm writing the BR to fresh wages, based on the number of days in the month.

Fix(Jan:DEC)

"Salary" = ("Annual salary"-> "BegBalance" / 12) * "workforce";

The existing calculation was ' wages divided by months no .of (12) ", now instead of number months wages that need to be calculated ("BegBalance"/ No..) OF DAYS IN THE MONTH) * 12.

Can someone pls guide me, how to begin writing the BR for 'No. DAYS OF THE MONTH.

You can do an admin enter number of days in the month. I remember CL reminding me the rhyme thirty days has September - Wikipedia, the free encyclopedia

Jokes aside, you can use SQL to get the number of days. You will get different options for SQL and Oracle.

If you want to continue to do this in BR then

Fix(Jan:DEC)

IF (@ISMBR (SEP) OR @ISMBR (Apr) OR @ISMBR (Jun) OR @ISMBR (Nov))

("Salary" = ("annual salary"-> "BegBalance" / 30) * 12) * "workforce";

ELSEIF (@ISMBR (Jan) OR @ISMBR (Mar) OR @ISMBR (May) OR @ISMBR (July) OR @ISMBR (Aug))

("Salary" = ("annual salary"-> "BegBalance" / 31) * 12) * "workforce";

ELSE (@ISMBR (Feb))

IF (@Remainder($CurrYr/4) == 0)

("Salary" = ("annual salary"-> "BegBalance" / 29) * 12) * "workforce";

ON THE OTHER

("Salary" = ("annual salary"-> "BegBalance" / 28) * 12) * "workforce";

ENDIF

ENDIF

ENDFIX

Concerning

Celvin

http://www.orahyplabs.com

Post edited by: CelvinKattookaran

Tags: Business Intelligence

Similar Questions

  • Get the number of days in a month based on the month and year of fields

    I have a column in my form which lists the days in a month. I want to configure a hidden field that calculates the total number of days in a month, based on the month and year of the field inputs. The number of days will determine what appears on the column. For example, if I put 4 months, and 2016 in the field of the year, I get 30 in the hidden field. Thus, on the column 'Day', I'll have numbers 1-30. Or if I put 2 months and 2016 in the field of the year, I get the 29 in the hidden field. If the numbers 1-29 appears in the column 'day '.

    Found this on some forum javascript code:

    //Month is 1 based
    function daysInMonth(month,year) {
      
    return new Date(year, month, 0).getDate();
    }

    //July
    daysInMonth
    (7,2009); //31
    //February
    daysInMonth
    (2,2009); //28
    daysInMonth
    (2,2008); //29

    I do not know how to convert this code in JavaScript to adobe and don't really know how to use it. All I know how to do is to configure the field values for the field month and year as variables. I am a novice programmer and would appreciate it really all the help I can get. Thank you in advance!

    The code seems to be JavaScript and runs as needed by using the JavaScript console.

    I would like to consider making more general code, so if you have a date string that includes at least the month and year we could just call the function and get the number of days for that month.

    The following script will calculate the number of days in a month, by using at least the month and year values can display the result on the JavaScript console and all of the value field for the field that has this code as the custom calculation Script.

    function daysInMonth (oDate) {}
    return new Date (oDate.getFullYear (), oDate.getMonth () + 1, 0) .getDate ();
    }

    nMonth var = this.getField("Month").valueAsString; get the value of month;
    nYear var = this.getField("Year").valueAsString; get the value of the year;

    Event.Value = "";

    If (nMonth! = "" & nYear!) = "") {}
    var MyDate = util.scand ("' / mm/yyyy ', nMonth +" / "+ nYear); convert to date object;
    var nDaysInMonth = daysInMonth (MyDate); get the number of days;

    Console.Open (); Open the JavaScript console;

    Console.clear(); clear the console;

    Console.println ("Days in" + nMonth + ":" + nDaysInMonth); show days in month;

    Event.Value = nDaysInMonth; Set the value of the field;

    }

  • Function to return the number of days in a month?

    In one of my rules, I need to allocate an amount of benefits based on the number of days remaining in the calendar month.

    OPM does have a function that can provide me with the number of days in a calendar month?

    Thank you very much
    Isamu

    It is not a direct function to do this, however, it can be done with a bit of messing around. The following rules you will get the number of days of the month of the date of the date

    Basically, you get the first day of the month, add a month to the first day of the following month and then get the number of days between them, which will give you the number of days of the month of the date

    the month = ExtractMonth(the date)
    the year = ExtractYear(the date)
    the start of the month =MakeDate(the year, the month, 1)
    the start of the next month = AddMonths(the start of the month, 1)
    The number of days in the month = DayDifference(the start of the month, the start of the next month)
    

    These rules can be a little more compact, but it is basically how to do it.

  • How to get the number of days in a month of belonging to a range of dates

    Hi, I'm going crazy around a problem, I have 2 dates and one month I wanto to retrieve the number of days belonging to the months that fall within the range.

    for example:

    month of January 2011. begin_date = January 11, 2011, May 30, 2011 end_date result is 21
    month of January 2011. begin_date = December 11, 2010, result of end_date, January 10, 2011 10
    month January 2011 .begin_date = 2 February 2011, end_date may 25, 2011 result 0
    month of January 2011. begin_date = January 3, 2011, January 5, 2011 result DATE END 3

    and so on...

    I appreciate any suggestion
    Thank you


    Andrea

    Something like that... ?

    SQL> with t as
      2  (select  to_date('11/01/11','dd/mm/yy') from_dt,
      3           to_date('30/05/11','dd/mm/yy') to_dt,
      4           'Jan-11' mnth from dual)
      5  select least(last_day(to_date(mnth,'Mon-yy')),to_dt) -
      6         greatest(to_date(mnth,'Mon-yy'),from_dt) cnt
      7  from t  ;
    
           CNT
    ----------
            20
    

    If 0 is also expected...

    SQL> with t as
      2  (select  to_date('11/01/11','dd/mm/yy') from_dt,
      3           to_date('30/05/11','dd/mm/yy') to_dt,
      4           'Jan-11' mnth from dual union all
      5           select  to_date('11/01/11','dd/mm/yy') from_dt,
      6           to_date('30/05/11','dd/mm/yy') to_dt,
      7           'Jan-12' mnth from dual
      8           )
      9  select from_dt,to_dt,mnth,
     10         greatest(
     11              least(last_day(to_date(mnth,'Mon-yy')),to_dt)
     12              -
     13              greatest(to_date(mnth,'Mon-yy'),from_dt)
     14                 ,0) cnt
     15  from t;
    
    FROM_DT   TO_DT     MNTH          CNT
    --------- --------- ------ ----------
    11-JAN-11 30-MAY-11 Jan-11         20
    11-JAN-11 30-MAY-11 Jan-12          0
    

    Published by: JAC on February 9, 2012 19:22

  • Dynamically calculate the number of days between two dates and amounts of split

    Hello

    I have searched for a solution for this, but had no success.
    I need to show the amounts broken down by days.

    I have a table that has an amount column and start and end dates.

    I need to write a query so that the amounts will be broken evenly based on the number of days between the start date and end date.

    For example, for this line.
    insert into my_test values (' 1, '' 3-mar-2010, ' 7 - mar - 2010 ", 1000);

    the query returns this (split $1,000 over 5 days)


    ID Date amount
    1 ' 3-mar-2010' 200,00
    1 ' 4-mar-2010' 200,00
    1 ' 5-mar-2010' 200,00
    1 ' 6-mar-2010' 200,00
    1 ' 7-mar-2010' 200,00



    create table my_test)
    ID number (10),
    start_date date,
    End_date date,
    amount number (10.2)
    );


    Select * from my_test

    insert into my_test values (' 1, '' 3-mar-2010, ' 7 - mar - 2010 ", 1000);
    insert into my_test values (2, 10-mar-2010 ", 19-mar-2010", 2000);
    insert into my_test values (3, 20-mar-2010 ',' 21-mar-2010, 5000);



    Thanks in advance.

    Hello

    One way is to join a Meter of Table , a table, or (more often) a set of results includes a line for eery number 1, 2, 3,... until the maximum number of times you need to divide a line.
    For example:

    WITH     cntr     AS
    (
         SELECT     LEVEL - 1     AS n
         FROM     (  SELECT  MAX (end_date - start_date)     AS max_day_cnt
                 FROM        my_test
              )
         CONNECT BY     LEVEL <= 1 + max_day_cnt
    )
    SELECT       t.id
    ,       t.start_date + c.n                    AS dt
    ,       t.amount / (t.end_date + 1 - t.start_date)     AS amt
    FROM       my_test      t
    JOIN       cntr            c     ON     c.n <= t.end_date - t.start_date
    ORDER BY  id
    ,            dt
    ;
    

    This assumes that all dates have the same number of hours, minutes, and seconds, as is the case in your sample data.
    If this isn't the case, then use TRUNC (start_date) and TRUNC (end_date) instead of start_date and end_date or post some sample data and results if some lines do not represent a whole number of days.

  • Need to obtain equal records the number of days of the month.

    Dear all

    My table and its data is given:

    Table name: Transaction_Master

    Trn_Num Trn_Dte
    1January 2, 2014
    2January 3, 2014
    3February 15, 2014
    4December 29, 2013
    5December 30, 2013
    and so on

    Now, I wish that my query must return equal records the number of days for each month of Trn_Dte. Be careful, I don't have Trn_Num column in my result. Its cities here only for explanation.

    It should, for example, records 31 to January 31 to December and 28 February.

    I tried following query but it passes loop and my db session gets hang.

    With T as

    (

    Select Distinct (Trn_Dte, 'Month') To_Char Trn_Mon, To_Number (To_Char (Last_Day (Trn_Dte), 'DD')) Tot_Day

    Of Transaction_Master

    Where Trn_Dte between parameter_1 and PARAMETRE_2

    )

    Select Distinct Trn_Mon, level

    T

    Connect by level < = Tot_Day

    Order By Trn_Mon, level

    Could you give me a solution for this case?

    Another solution for your exact needs. Try this and let me know in case of any problems. Because I changed the connection by the clause double itself.

    SELECT DISTINCT TRUNC (Trn_Dte, 'MY') + (lvl - 1)

    OF Transaction_Master aa (SELECT LEVEL lvl

    OF the double

    CONNECT BY LEVEL<= 31)="">

    WHERE Trn_Dte<= to_date('15-feb-2014','dd-mon-yyyy')="" ---="" add="">

    AND TO_CHAR(Trn_Dte,'MON') = TO_CHAR (TRUNC(Trn_Dte,'MON') + (lvl-1), 'MY');

  • Calculate the number of days remaining until the next anniversary. Help, please!

    Hi guys,.

    I'm new to the forum and to the development of BB. So please do not judge harshly if the answer to my question seems obvious.

    I need to calculate the number of days until the next birthday (taking into account any valid birth date)

    After looking at the API and the forum search, I realized that I could

    calculate the difference between two dates in milliseconds and then divide the delta of the value of a day in milliseconds. That is to say:

    birthdayCalendar.set (Calendar.YEAR, those);

    Date1 = birthdayCalendar.getTime () .getTime ();

    date2 = System.currentTimeMillis ();

    Delta = date1 - date2

    numOfDays = delta\DateTimeUtilities.ONEDAY

    Here's my question. How do I create a valid date1 what about leap years?

    Maybe there's a better way to solve this problem?

    Any help is greatly appreciated.

    I agree that the determination of the number of days between today and Feb. 29 could be a little difficult, if it is not a leap year.  I suspect that the calendar has a certain built-in mechanism to compensate for this, but your solution to choose a date is better.

    DST has a role to play, and Yes, the calendar makes up for it.  Let us take two dates, for example (before DST) March 1 and June 1 (after the DST).  If you take a calendar and set the same hour, minute, etc., they are all the same except for dates, then subtract one from the other, and then divide by the number of milliseconds in 1 hour, you calculate the number of hours between the same time on two different days.  You will find that it is not a multiple of 24 hours - because there is actually an hour less than the number of days since the clocks move forward (in the northern hemisphere anyway...),

    In your case, you are not calculating the number of hours, you calculate the number of days.  But you will be dividing by [24 * (time in an hour)].  If you take [23 * (time in an hour)] and divide it by [24 * (time in an hour)], using arithmetic on integers, you will end up 0.  The easiest to get around this, who also works for the end of the DST too, is to simply add one hour to the date before the division.

    Hope that makes sense...

  • divide the table based on the number of lines

    Hello

    I am trying to split a table based on the number of lines and then treat.
    Say I have a TEST_XXX table that contains 50 lines, what I would do is.
    to access multiple lines of 10. How can we achieve this?

    What I thought is, once the table is created and the line are filled.
    Add a new column to the table and perform a procedure that inserts of 1 to 10 first lines
    and 2 to 10 lines and 3 to 10 next ranks... etc. Based on this, that we can treat
    the first set of lines then play next or etc...

    is there a better way to do it?

    Code to create the table:
    CREATE TABLE TEST_XXX
    (
      A_ID   VARCHAR2(10),
      B_ID   NUMBER,
      c_ID   VARCHAR2(10),
      D_ID   NUMBER
    )
    Code to add lines:

    DECLARE
    BEGIN
      FOR I IN 1..50
      LOOP
          INSERT INTO TEST_XXX VALUES('ABCDE',123,'ZYXWV',321);
      END LOOP;
      COMMIT;
    END;
    The original problem is, I have a huge table, and I write a sql query to process,
    When I treat him by selecting all the values in the table, it is very slow.
    But when I have treat small Coulon (say 100 rows), it works very well.
    That's how I got the approach described above in mind.

    You can use NTILE.

    See:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions101.htm#SQLRF00680
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:47910227585839

  • to calculate the number of days between 2 dates

    Hi all


    I need to calculate the number of days between 2 dates.
    Y at - it no oracle built on that basis.



    Thanks in advance
    Kind regards

    Nick

    user646786 wrote:
    Hello

    Thanks a lot its really useful, but I must make a correction, I just want weekdays rather working days

    As already said, there are many examples on the forum of the calculation of the working days or the days of the week or whatever you want between certain dates of restrictions. You will need to have a go at adapting what has already been given before and then when you get stuck, come here and your postcode, and someone will take a look for you.

  • Gets the number of records in the report based on the input of the user on the date and the number of days.

    Hello

    I need where there are quick dashboard that selects the date, second interval column consists of >, <, = and the third column is seen number (in days)

    for example, the user enters: 12 18, 2015, <, 9. here I report who should get the data (records) 9 days earlier from the date specified (from 12/10/2015 to 18/12/2015).

    Similarly for > =.

    How to get there. I'm unable to write the script and I use the column date in my report. Ask that you please advice how to solve this problem.

    Please find below the screen for reference.

    timediff.jpg

    Kind regards

    Chandra Khalil.

    Hello

    Not exactly why you're doing the report this way. If the user must select, basically, a period of dates, would not easier to have a column of data with a between the operator and the user would select 2 dates (upper and lower intervals)?

    In any case, it is possible to achieve what you want to do as a result of your approach. You could use when's CASE and have a more complex filter, but I think that it is better to have a few nested filters where you use the range operator to determine what date filter that you use (see image below)

    Some notes about my filter. First of all, I am making the assumption that the operator is "=", then the number of days specified must be ignored and you just return the data for the selected date. You will notice also that in my filters, I got a cast so far, but if you are using a column that is already a timestamp so it won't be necessary.

    This should achieve what you want.

    See you soon,.

    Pedro

  • How to calculate the number of days/weeks/months between 2 dates?

    Hello

    I would like to know how to calculate the number of days/weeks/months between 2 dates in OBIEE 11 g, for example, I have 26/05/2013 and 19/05/2013, then I want to get 7 days.

    Thank you!
    Jamie

    Hi Jamie,

    Through this links...

    http://www.bravesoft.com/blog/?p=682
    http://twobiee.blogspot.in/2012/01/working-with-date-differences.html

    Mark as correct it allows u...
    Thank you...

  • How to calculate the number of days between dates

    How can I determine the number of days between 2 dates? Say today and 10/07/46

    Thanks Bob

    You could do it like this:

    Photoperiod var = 1000 * 60 * 60 24; number of ms in a day

    var today: Date = new Date();

    var every time that: Date = new Date (1946,6,10);

    var diff = Math.floor((today.getTime()-whenever.getTime())/dayLength);

    trace (diff)

  • Count the number of days of previous instance entity

    Hello

    My context, global and one of many relationship which is a list of contracts.

    I think I can explain my problem with an example:

    Contract 1:

    Start date: 01/01/2013

    End date: 31/03/2013

    2 contract:

    Start date: 05/01/2013

    End date: 31/08/2013

    Contract 3:

    Start date: 11/01/2013

    End date: 31/03/2014

    I want to do this:

    For contract 3, calculate the number of days for contract 1 + contract 2 + 3 contract

    For the market 2, calculate the number of days for the 2 + 3 on contract market

    To contract 1, calculete number of days for contract 1

    Moreover, I would calculate the number of days limited to 28 months before the date of the end of each contract.

    For contract 3 calculate the number of days until the 31/03/2014 but on 30/11/2011.

    Means that

    -If a contract of 4 ends before 30/11/2011-> not taken

    -If a contract of 4 begins on 11/01/2011 and ends on 15/12/2011, the days of the 12/01/2011 to 15/12/2012 are taken into account.

    For contract 2 calculate the number of days until the 31/08/2013, but since 30/04/2011.

    Means that

    -If a contract of 4 ends before 30/11/2011-> not taken

    -If a contract of 4 begins on 11/01/2011 and ends 15/12/2011-> not taken

    Hope my explanation is clear.

    I don't know how mixt:

    temporal reasoning

    reasoning of entities

    through the reasoning of entities

    as

    -for a contract, I have to see all deals before and not one after (cross entities reasoning)

    -I have to count a number of days, but if there is a period without a contract that I have to ignore days (temporal reasoning)

    Then I am quite lost.

    If anyone can help me in this situation aprehendate the appropriate.

    Thank you.

    Hey guys I think I found the solution, here my idea in french (sorry my client is franco-french):

    the contract if course of est en

    Temporelencoursouapres (contract start date)

    and

    TemporelEnCoursOuAvant (date of end of contract)

    a contract is being so

    Exists (employment of the applicant, the contract is ongoing)

    the value of the number of days to count pour the contract to determine the last date of end of contract to take into account

    0

    TemporelAvant (InstancesMinimum (employment of the applicant, the start date of the contract))

    0

    TemporelAvant (the start date of the contract to determine the last date of end of contract to take into account)

    0

    Temporelapres (InstancesMaximum (employment of the applicant, the end date of the contract))

    0

    Temporelapres (date of end of contract)

    0

    Temporelapres (the end date of the contract to determine the last date of end of contract to take into account)

    3

    the day is the last day of February

    and

    Temporelencoursouapres (the start date of the contract to determine the last date of end of contract to take into account)

    and

    a contract is underway

    1

    No (the day is the last day of February)

    and

    Temporelencoursouapres (the start date of the contract to determine the last date of end of contract to take into account)

    and

    a contract is underway

    0

    otherwise

    the value of the number of days through contracts pour prescribe the last contract end date to take into account = Temporeldatedepuisdebut (all jobs of the applicant, the date (the number of months to be taken into account for the period affiliation) months before the end date of the contract, the value of the number of days from paying the contract to determine the last date of end of contract to take into account)

    the duration of contracts from pour prescribe the last contract end date to take into account = IntervalleSommeQuotidienne (the start date of the contract to determine the last date of end of contract to be taken into account; AddDays (InstancesMaximum (employment of the applicant, the end date of the contract) 1); the value of the number of days through contracts pour prescribe the latest end date of contract to take into account)

  • JavaScript anomaly on the number of days between two dates

    Use ApEx 4.0, I found an anomaly in a javascript code that calculates the number of days between two dates, the current_date and the past_date. If the past and present is the or before March 10, 2013, and the current_date lies between 10 March 2013 and November 3, 2013, the number of days will be from 1 day to less than the actual number. Between November 3, 2013 and on 4 November 2013, the increments of number by 2, then the count will be accurate from this date forward.

    Here are some examples:

    March 10, 2013 = 69 days of December 31, 2012
    March 11, 2013 = 69 days of December 31, 2012
    March 12, 2013 = 70 days of December 31, 2012

    November 3, 2013 = 306 days in December 31, 2012
    November 4, 2013 = 308 days in December 31, 2012

    11 March should be 70 and 12 March should be 71. November 3 is 307 and 4 November corrects the number of fake, which began March 11.

    Change the past_date to March 10, 2013 produces the following:

    March 10, 2013 = 0 days of March 10, 2013
    March 11, 2013 = 0 days of March 10, 2013
    March 12, 2013 = 1 days of March 10, 2013

    But change the past_date to 11 March 2013, product of the correct numbers:

    March 11, 2013 = 0 days of March 11, 2013
    March 12, 2013 = 1 days of March 11, 2013
    March 13, 2013 = 2 days of March 11, 2013

    I would certainly all help to determine the cause of this anomaly. Here's the javascript code:

    var w1 = ($v ("P48_PAST_DATE"));
    W1 = (w1.toString ());
    vmon var = (w1.substr (3.3));
    vyr var = (w1.substr (7));
    var r = (vyr.length);
    If (r == 2)
    vyr. = (parseFloat (vyr) + 2000);
    vday var = (w1.substr (0.2));
    var y = (vmon.concat ("", vday, ",", vyr));
    y = Date.parse (y);

    var w2 = ($v ("P48_CURRENT_DATE"));
    var vmon2 = (w2.substr (3.3));
    var vyr2 = (w2.substr (7));
    var vday2 = (w2.substr (0.2));
    var x = (vmon2.concat ("", vday2, ",", vyr2));
    x = Date.parse (x);

    var numdays = (x - y);
    numdays = (Math.floor(numdays / 86400000));
    $s ("P48_NUMBEROFDAYS", numdays);

    Did you google for something like "javascript number of days between two dates. I think you will find the explanation to this observation:

    This method does not work correctly if there is an advanced economies jump between the two dates.

    There are examples available to calculate the difference between two dates.

  • How to find the number of days between 2 date elements in the XSLT file

    Hello

    I need to calculate the number of days between 2 date elements (type xs: date). Can you please direct me as to how I can do the same thing.

    I work in 11g and using XSLT 1.0. I tried several options but yet to get a solution for this. I think that this can be done also using XSLT 2.0, but who has not worked for me.

    Can someone please help with this problem, thanks in advance!

    Thank you
    Anju

    Hello

    Have you seen this message?
    Re: Get the Date difference between 2 values of date in days

    You can do in the XSLT file since the dates are in ISO 8601 format.
    http://www.w3.org/TR/NOTE-datetime

    Here is a sample XSLT...

    
    
    
    
    
    
    
    

    The XSLT above will result in * 4 * for the next entry...

    
    2012-01-11T00:00:00.000-05:00
    2012-01-15T00:00:00.000-05:00
    
    

    You can test this example here...
    http://xslttest.appspot.com/

    I hope this helps...

    See you soon,.
    Vlad

    It is considered good etiquette to the answerers rewards with points (as "useful" - 5 pts - or 'correct' - 10pts)
    https://forums.Oracle.com/forums/Ann.jspa?annID=893

Maybe you are looking for

  • Need to access the advanced settings.

    I downloaded a program called Clownfish. Unpon opening Skype an allow / deny access screen appears. I would need to allow manually Skype to use this program but were unable to find advanced on the 8.1 settings app and have become very frustrated and

  • Can LabVIEW open a *.txt file in Notepad?

    I'm logging data in a *.txt file when running a LabVIEW VI.  When the user presses the "Exit" button, I want a dialogue window for display and ask the user if he or she wants to open the data *.txt file using MS Notepad.  Is this possible?  If so, ho

  • Impossible to delete the Inbox in outlook express

    I've had problems with Outlook Express 6.0 for a couple of minths now.  I can't delete messages in my Inbox and I can't drag those I want to save to other folders.  It is also extremely slow to open now. Any ideas that I can do to get this back to th

  • phone calls claiming I erros on my computer and they need to connect to it to repair

    Hi, I received phone calls from a guy who says he works for pc24by7, which is something to do with Microsoft apparently. He said that I have errors in my event log (which I do) and THST if its not fixed my pc can fail at any time. To correct what is

  • Import-Module via a scheduled task results in different $env: modulepath

    Just upgraded to PowerCLI 6.0 R3Anyone encountered this?  I was updating my scripts of scheduled to begin importing the module rather that to add the snap-ins, but for some reason when Task Scheduler is running scripts, it basically-error w / unable