Compare the months in the calculation

Hi guys,.

I have a question about calculations in Essbase (calcscript).

I want to know if a month (for example Jan) is less than (<) the other month (e.g., Feb).

The first month is in a variable (& BasePeriod), the second month is @currmbr (periods).

A comparison between these is fine for the following operators: <>, ==.

But I need to know if the first is 'small' (earlier in my size) than the other.

My rules are in a time dimension.

And are built like:

Year

1ST QUARTER

Jan

Feb

Mar

etc.

I hope you guys can help.

Right, but you are not asked to compare the two members of dimension period arbitrary; only & BasePeriod and @CURRMBR ("Periods"):

«The first month is in a variable (& BasePeriod) second month is @currmbr (periods).»

But I need to know if the first is 'small' (earlier in my size) than the other. »

@ISMBR("Jan":&BasePeriod) returns TRUE when @CURRMBR (Periods) is earlier or equal to & BasePeriod

@ISMBR("Jan":&BasePeriod) AND NOT @ISMBR(&BasePeriod) returns TRUE if @CURRMBR ("Periods") is prior to & BasePeriod

To compare the other way around you can reduce to zero the expression.

@ISMBR("Jan":&BasePeriod) NO returns TRUE when & BasePeriod is earlier than @CURRMBR ("Periods")

NO @ISMBR("Jan":&BasePeriod) OR @ISMBR(&BasePeriod) returns TRUE & BasePeriod is earlier or equal to @CURRMBR ("Periods)

Is it not what you ask?

Tags: Business Intelligence

Similar Questions

  • Compare the amount of the previous month based on the account number

    Hi team,

    In my table of the source, amount aggregated by month for a given account there
    ACCOUNT_NUMBER          YEAR          MONTH          AMOUNT
    ---------------          -------          ------          -----------
    123456789          2012          01          450.00
    123456789          2012          02          -234.00
    123456789          2012          03          0.00
    123456789          2012          04          890.00
    123456789          2012          05          78.00
    123456789          2012          06          44444.00
    123456789          2012          07          450.00
    123456789          2012          08          450.00
    123456789          2012          09          450.00
    123456789          2012          10          120.67
    123456789          2012          11          176.88
    123456789          2012          12          450.00
    123456789          2013          01          340.00
    Now, I need to add a column more in this area, with logic below. There will be more than 1000 accounts available. For each account I need to achieve this.

    CASE WHEN MONTH_AMOUNT = 0 THE CASE OTHERWISE 1-0 WHEN PREVIOUS_MONTH_AMOUNT = 0 THEN 0 1 OTHER)

    On this basis, the objective should be
    ACCOUNT_NUMBER          YEAR          MONTH          AMOUNT          FLAG
    ---------------          -------          ------          -----------     -------------
    123456789          2012          01          450.00          1
    123456789          2012          02          -234.00          1
    123456789          2012          03          0.00          -1
    123456789          2012          04          890.00          1
    123456789          2012          05          78.00          1
    123456789          2012          06          44444.00     1     
    123456789          2012          07          450.00          1
    123456789          2012          08          450.00          1
    123456789          2012          09          450.00          1
    123456789          2012          10          0.00          1
    123456789          2012          11          0.00          0
    123456789          2012          12          450.00          1
    123456789          2013          01          340.00          1
    can someone help me how to compare the value of the previous month. All columns have the data varchar, except for the quantity type.

    Hello

    I have not tried. But this desire.

    SELECT
    ACCOUNT_NUMBER,
    YEAR,
    MONTH,
    AMOUNT,
    CASE WHEN AMOUNT = 0 THE 0 ELSE 1 - CASE WHEN LAG(AMOUNT, 1, 0) OVER (PARTITION BY ACCOUNT_NUMBER ORDER BY YEAR, MONTH) = 0 THEN 0 ELSE 1) AS FLAG
    FROM SOURCE_TABLE;
    

    See you soon
    Didier

    Published by: Didier vishwakarma on 6 March 2013 12:36

  • Compare the text of the combobox as a condition in the calculation of the field another.

    I'm doing a condition, if one of the 15 comboboxes has a certain value of selected text list, then a button is displayed.

    I tried to follow this example, which I found here on another question:

    var t = document.getElementById ("fTerminalType");

    selectedText var = t.options [t.selectedIndex] .text;

    the part of my code that uses it is:

    for (i = 1; i < 16; i ++) {}

    var t = this.getField ("ComboBox" + i);

    var s = t.options [t.selectedIndex] .text;

    If (s == 'Specific text') {}

    k.Display = display.visible;

    }

    }

    "Combobox1" so has "A specific text" selected, but the "k" key does not appear visible, and the rest of the code (a calculation) returns empty.

    If I delete the internal code of "for () {}", the rest of the calculation works, if the syntax error is specific to the part of text comparison.

    I tried 'value', ".innerHTML", ". export.value", '.change' and '.changeEx' instead of '.text', nothing has worked.

    I don't know if pdf forms have jQuery, I could try it but that he would need assistance with the code so be it.

    Thank you.

    The value property returns the value of export of the selected item if it has one, otherwise it returns what appears, which is what you call text. SO if someone type something, you can retrieve it with the value property, even though you really better to use valueAsString. Check the console JavaScript (Ctrl + J) to see if errors are reported.

    If you need to get the value of the export value display, you can use the field currentValueIndices property to get the index of the selected item and use it with the field getItemAt method to get the display value. A code example is the Acrobat JavaScript reference.

    I don't notice anything wrong with your script updated, if you add a break after the k.display statement statement, since you do not need to keep a loop once it is set. Unclear if it is initialized to display.hidden somehow, what would make sense.

  • By comparing the data in the pass of 2 tables - with a calculation

    There are 20 records in 2 different tables (A and B). Records relate to periods between Jan 07 and 09 March. There is a logic that says that all records of 15 who are understood between Jan 07 and 08 Dec; their amount must be changed in Table B. While the amount for the rest 5 records that fall between Jan 09 and March 09 would remain the same. The formulas to be applied in the first 15 recordings is "amount/.50*0.125" and this result should take into account in the new table in the amount column.


    Now the task to ensure that the calculation that happened correctly in table A, for these 15 records that fall between January 2007 and December 2008 in Table B, and that the amount is the same for the records for the period after January 2009. I will conduct trials only that the new amount after the calculation of business logic is reflected in the new column of Table B.

    This, to a sql statement.

    Thank you

    Dush

    you might want to try this pseudo-code

    update [2nd table]
       set amount = (select t.amount / .50 * 0.125
                       from (select id, rownum rn, amount
                               from [1st table]
                              where period_date between '01-JAN-07' and '31-MAR-09'
                             order by id) t
                     where  t.rn <= 15
                       and  t.id = [2nd table].id)
     where id in (select t.id
                    from (select id, rownum rn, amount
                            from [1st table]
                          where period_date between '01-JAN-07' and '31-MAR-09'
                          order by id) t
                   where  t.rn <= 15)
    

    It's even better if you can post the actual tables, columns and a few examples of data

  • How to compare the time slices in 15 minutes?

    Using Flash 8 Pro AS2

    Have an animation to play once at the first visit to the site, regardless of the number of pages visited within the site. Then start over when to return to site.

    I thought that SharedObject would work for this. I managed to do it run at the same time to visit the site and the value of the shared object. Problem is that the animation NEVER play again because the shared object is never removed.

    Is there a way to put so it was like a session then that would solve this easy. I don't know how to do if there is a way.

    So I decided to make the swf file to check the page reload or if come back once again, site 15 minutes has elapsed. If so, update the time in being shared right now and the animation playback.

    Problem is that I have NO idea how compare the time set in the shared object at the moment to check whether or not the 15 minutes has passed.

    I tried different things, but the comparison, at the end of the hour, goes into the negative numbers. I am here minutes passing between saved time and the current time. Nothing else for a few minutes.

    I'm not a mathematical genius or understand all the stuff that I see out there in the tutorials and code examples, when it comes to the date and the time of calculation.

    I need to be. Delete the shared object to the closure or the site navigation browser.
    OR
    Check if 15 minutes has passed then at day time in the shared object and read the animation

    I'm just stuck in the calculation of time to determine whether or not the 15 minutes passed.

    What happens if they return to the site of the days or even weeks? My minutes of follow-up test has no meaning when entering hours and days or even weeks or months. Of course, my approach does NOT work.

    Any help would be great. Don't forget to Flash 8 pro and AS2 NOT AS3 or flash 9.


    Thank you

    I don't know how you look at the time, but if you create a DATE object:

    var today: Date = new Date(); It's actually an object of date and time.

    So, if you compare this date and time with an earlier date object and the object of time by using the Date method getTime() as follows

    Now.getTime () - previousDate.getTime () = the number of milliseconds that have elapsed between the "previousDate' and 'now '. If the difference is > 15 * 60 * 1000, 15 minutes.

  • What formula would I use to add all the other ranks in my spreadsheet. I want to compare the fees and expenses of 2015 since they are incurred for 2016

    On the same worksheet, I want a spreadsheet to compare spending 2015 totals by month in several categories to 2016 expenses when they occur. What is the best way to implement this worksheet? It is essentially a budget, but wants to see how the category spending increase or decrease all the months for 2016.

    Thanks for any help.

    Hi Bruddah,

    I would like to start by rearranging your table so that the amounts from here to 2015 and 2016 switch not in the column, as implied in your question.

    Vocabulary of the numbers:

    worksheet not sentence numbers

    Worksheet: A spreadsheet. Usually abbreviated to 'Document '.

    Leaf: a blank canvas on which are placed the tables and other objects. A Document has at least one and maybe more than one.

    Table: an object consisting of one or more cells, arranged in rows and columns.

    Take a look at the personal Budget template (file > new form model...), specifically the summary in the table of categories.

    It uses the formula: = SUMIF (Transactions::Category, A2, Amount)

    Since you want to compare the volumes in several CATEGORIES at the specific two-year MONTH, you will need SUMIFS, using three test values, pairs of condition.

    Syntax: = SUMIFS (sum of the values,test values,condition,test values,condition,test values,condition)

    I would like to know if it is enough information. If this isn't the case, I'll be later in the day to enter more specific details. In the meantime, a screenshot of your table and the lines of (at least) your transactions table header would be probably useful.

    Kind regards

    Barry

  • Block Oracle's PL/SQL by comparing the values to 4 decimal places

    Hello

    I use Oracle Database 11 g 2. I wrote a simple PL/SQL block that validates as false. Basically trying to ensure that the calculation of FX's 4 correct decimals.

    Example if,

    1,000 vs 1.0000 should have the value false

    1,0000 vs 1.0000 must be set to true

    To this end, I'm doing string comparison. I don't know why the following code evaluates to "false", or what is the right way to make this comparison in PL/SQL?

    declare
    l_fx_rate varchar2(100) := to_char(1, '9999.9999');
    l_aud_usd varchar2(100) := to_char((23/23),'999999.9999');
    
    
    BEGIN
    htp.p(l_fx_rate);
    htp.p(l_aud_usd);
      IF l_fx_rate = l_aud_usd
      THEN
    htp.p('true');
      else
    htp.p('false');
      END IF;
    END;
    

    Thank you.

    • l_fx_rate varchar2 (100): = to_char (1, '9999.9999');
    • l_aud_usd varchar2 (100): = to_char ((23/23), '999999.9999');

    The first STRING has 4 digits left of the decimal separator and the second CHANNEL has 6 digits to the left of the decimal separator.

    4 is NOT equal 6.

    You can EASILY see if you actually view the values that uses Oracle.

    with q as (select to_char (1, '9999.9999'), v1, v2 to_char ((23/23), '999999.9999') of double)
    Select the v1, v2, dump (v1), (v2) dump, case when v1 = v2 then "true" end if 'false' q v3

    V1 (V1), V2, DUMP DUMP (V2), V3

    1.0000, Typ = 1 Len = 10: 32,32,32,32,49,46,48,48,48,48, 1.0000, Typ = 1 Len = 12: 32,32,32,32,32,32,49,46,48,48,48,48, false

    See the 4 space characters (32,32,32,32) in the first value chain? See the 6 in the second value?

    Oracle compares "1.0000' to ' 1.0000' and the strings are NOT the same."

  • How to make the calculation script to show 2 decimal places and stop rounding down to integers?

    Hello. First of all, thank you to those of you who have helped me create an interactive PDF file last year that worked perfectly if only integers are entered. This year, my client wants to show two decimal places in the calculations, and I'm back in this forum hoping to find the same expertise to make it happen.

    My form includes 43 fields for various monthly expenses. The sign of dollar for each field is part of the content of the form, not part of the scope of formatting. Users enter values directly in these fields, and the fields are formatted to display two decimal places. Each of these includes a the following validation script:

    Event.RC =! (event.value & & + event.value < 0);


    To the right of each of these fees, the fields are yes/no boxes ( expense Typecalled) that answer the question, "is this essential expense? The value of exports for Yes's 'essential', and the value of exports is "discretionary".


    A value entered in all areas of expenditure is directed to the field Total expenses by checking Yes or field Total discretionary spending by clicking No. two of these total fields are formatted to display two decimal places. In addition to long calculation scripts, the two totals fields include this custom validation script:

    If (event.value == "0") {event.value = util.printx ("", event.value)}

    Here's the problem: when values with two decimal places are entered in any area of expenditure, the calculation in two fields of total script rounded to the whole number closest. When 10.99 is entered in a field of expenditure and the Yes checkbox is checked, the value 10.00 is displayed in the field Total expenses . I want to display 10.99.

    For testing purposes, I inserted a new text field and did a simple calculation in choosing the fields of the somme and the values displayed correctly. The problem is definitely with the script in the two fields in total .


    I can drop the scripts of math here, but they are long and I'm not sure what the Protocol is super-long positions. I could also download the file, but I never did it and will need to understand this.

    Thank you for taking the time to read this. If you can help me, very well!

    To explicitly convert the field values for numbers, do something like this instead:

    var expense0 = + getField('monthly$.0').value,

    depenses1 = + getField('monthly$.1').value,

    etc.

  • Comparing the spfile and pfile

    Hi all

    11.2.0.3

    I want to compare my pfile_old generated a month ago and the spfile current, just to check if there have been changes.

    So, I converted my current spfile to pfile_new. To make the taskeasy...

    Then, I created an external table for this 2 files with the same name.

    create table pfile_old (text1 varchar2 (100))

    external organization (type oracle_loader default BDUMP directory

    access parameters (records delimited by newline)

    location ("pfile_old.txt"))

    reject the limit 1000;

    create table pfile_new (Text2 varchar2 (100))

    external organization (type oracle_loader default BDUMP directory

    access parameters (records delimited by newline)

    location ("pfile_new.txt"))

    reject the limit 1000;

    =================

    But when I compare the values, none are equal?

    Select text1 from pfile_old less select Text2 pfile_new;

    everything is selected in pfile_old.

    How can I fix this?

    Thank you

    zxy

    Have you looked at the actual data in both files to see what are the real differences?  It is impossible for us to guess what may be different between the files, because we have no idea how the original pfile has been created or maintained.  You have two files.  You know what lines you expect to be the same.  You know, or can know, what are the real differences.

    If, once you know why they are different and determine the algorithm you want to use for comparison, we would be happy to help you to implement this algorithm if you know enough PL/SQL to do.  But you'll have to do the legwork.

    Of course, discover that something has changed by looking at the spfile rather than through good change control process is rather crazy in and of itself.  In the past, you indicated that you are somehow responsible for a large system.  There is no universe in which it makes sense for a DBA of a real production system (not to mention one who claims to have sensitive data or to be 24 x 7) to be surprised by a change in initialization parameter.

    Justin

  • SQL for the calculation of the salary

    Version: 11.2

    Permanent employees get monthly salary, contract workers get only commission.
    Some permanent employees such as PETER and JOHANN get salary and Commission


    I want to find the total amount paid to permanent and non-permanent.

    The computation of the total, for employees who receive the salary and Commission as PETER and JOHANN, I want to ignore the Commission and considers that pay them for the calculation of total compensation.
    ie. When computing the total amount paid to all these employees
    
        I want to ignore commision of 400 received by PETER 
        and
        I want to ignore commision of 1000 received by  JOHANN
    That is to say. The Total amount paid will be: 18 500

    create table pay_master (emp_type varchar2(50) , empname varchar2(50), salary number , comm number );
    
    
    insert into pay_master values ( 'PERM', 'KAREN' , 2000, 0 );
    insert into pay_master values ( 'PERM', 'HANS'  , 3000, 0 );
    insert into pay_master values ( 'CONTRACT', 'KEITH'  , 0, 1000 );
    
    insert into pay_master values ( 'CONTRACT', 'ABDUL'  , 0, 2000 );
    insert into pay_master values ( 'PERM', 'KRISHNA'  , 1000, 0 );
    insert into pay_master values ( 'CONTRACT', 'CHENG'  , 0, 1500 );
    insert into pay_master values ( 'PERM', 'PETER'  , 5000, 400 );
    insert into pay_master values ( 'PERM', 'JOHANN'  , 3000, 1000 );
    
    
    col EMP_TYPE format a10
    col EMPNAME format a10
    
    SQL> select * From pay_master order by empname;
    
    EMP_TYPE   EMPNAME        SALARY       COMM
    ---------- ---------- ---------- ----------
    CONTRACT   ABDUL               0       2000
    CONTRACT   CHENG               0       1500
    PERM       HANS             3000          0
    PERM       JOHANN           3000       1000           ---------------> Ignore this commision when calculating the total pay
    PERM       KAREN            2000          0
    CONTRACT   KEITH               0       1000
    PERM       KRISHNA          1000          0
    PERM       PETER            5000        400           ---------------> Ignore this commision when calculating the total pay
    
    8 rows selected.
    
    SQL> select EMPNAME , salary+comm from pay_master order by empname;
    
    EMPNAME    SALARY+COMM
    ---------- -----------
    ABDUL             2000
    CHENG             1500
    HANS              3000
    JOHANN            4000
    KAREN             2000
    KEITH             1000
    KRISHNA           1000
    PETER             5400
    
    8 rows selected.
    
    SQL> select sum(salary+comm) from pay_master;
    
    SUM(SALARY+COMM)
    ----------------
               19900
    
    
    Expected output from the SQL with the above mentioned logic is 18500
    How can I do this in SQL? I think that I can't use CASE here statement because the CASE statement works only in a single column. Right?

    Hello

    J.Kiechle wrote:
    ... I think that I can't use CASE here statement because the CASE statement works only in a single column. Right?

    A CASE results in a single value expression. It may depend on any number of columns (that is, of reference): 0, 1, 2, 3 or more.

    For example, the following is based on 2 columns, x and y:

    CASE
        WHEN  x > y
        THEN  x
        ELSE  y
    END
    

    which is just another way to get the same results that

    GREATEST (x, y)
    

    You can use either of the foregoing, for your problem (assuming that the salary and the Commission are always 0 or more).

    Published by: Frank Kulash, Sep 21, 2012 05:40

  • How to restore the calculator application to drag it to the top of the screen to control

    Can how I restore the calculator to drag it to the top of the screen to control center? It seems to have been removed from the bottom row? Thank you

    Are - what you got to remove the calculator of your applications on the phone? You can find the calculator on the phone itself? If you find it, then try a reset. Hold down the home and sleep/wake together until you see the Apple logo and then release. The phone will restart. There are no settings to change what appears on the display. See if the reset solves your problem.

    EDIT: what exactly you see in the Control Center? If you see only controls the music, then drag to the right to see the rest of the access to the control center.

  • Turn off the calculator keyboard sound iOS 10

    How to disable sounds click on keyboard in the calculator? "Keyboard clicks" is DISABLED in the settings.

    Me too, I am extremely frustrated with this change. For those of us who do not support the keyboard clicks, this regression is super boring!

  • Turn off the calculator clicks in iOS 10

    How to disable the sound of rattling when using the calculator application in iOS 10?  Keyboard clicks are already disabled in settings > sounds and is not the solution.

    The clicks seem to be controlled by ring settings. Using the Mute button will work, while reducing the amount could also reduce the ring volume.

    Maybe we should use the comments link to get the clicking sound of the calculator to silence again in a future update iOS:

    Apple - iPhone - Feedback

  • How can I disable the rattling of the calculator in iOS 10

    I actually use the calculator a little and I wear headphones to work.  The click is pretty boring, and the only solution I've come across is to cut off all the sounds that defeats the point of all the notification sounds that I use.  Please close the click or give me a way to make everything by letting other aspects only.  NOT an improvement.

    It is mainly a user support forum. I expected settings > sounds > keyboard clicks could solve the problem for you, but it doesn't. You can make a suggestion to Apple on http://www.apple.com/feedback/iphone.html

  • Premium HP: HP Premium: PROGRAM FOR DOING MATRIX OF BATTERY of the CALCULATOR (don't DO NOT WORK!)

    Hello!

    I attend the University for electrical engineering, and so I plan to buy a good calculator for my needs:

    -programmable with enough memory

    -graphical representation

    -"Advanced" math

    I have not discovered only recently on the amazing HP calculators (e.g. HP 50 g), which are capable of the RPN notation and thus make the calculations very fast and effective. I really hate the new calculators that announce the entry "quick and easy" using graphic symbols and cursor to select the location of the entrance! It of a lot of your time and makes me crazy, especially when it comes to long and "complex" calculations

    As I am not able to get the new HP 50 g, I looked at his "successor": first HP. But unfortunately there many defects in the RPN notation and also in some functions. But I'm willing to compromise, especially if I can write programs to replace some missing critical functions of HP 50 G.

    BUT, when I started looking into writing my own duties I quickly discovered that the lack of management functions of the inputs/outputs and even some strange/inexplicable behaviors.

    I wrote a program:

    EXPORT array()
    BEGIN
    LOCAL a, b, i, j;
    a: = years (1);
    IF length (a) == 1
    THEN
    b: = MAKELIST (years (X), X, a + 1, 2,-1);
    ON THE OTHER
    i: = a (1);
    j: = a (2);
    b: = MAKEMAT (years (i + j + 2 - J-(I-1) * j), i, j);
    END;

    (b) return;

    This program takes the last argument ("a") of stack for the size of the list/matrix.

    If the argument 'a' is a number (list 1 item), it creates a list of the last 'a' arguments from the stack. -> WORK

    Otherwise, it creates a matrix with columns and the specified lines. -> DOES NOT

    Now when I tested the code without I or J arguments MAKEMAT service, she worked OK. He worked too, if I used a very simple expression: for example I have J-1 or i + j - J + 2 (column only scanning).

    (The upper part (1 expression in the stack is the return value after execution of Array ()))

    OK LIST:

    MATRIX not OK:

    MATRICES OK, so current of enforcement only of years (i + j - J + 2):

    MATRIX OK, so current execution really simple Ans(I+J-1) function:

    Why these anomalies! I was really looking forward to buy HP Prime, but after all these issues and no real control on the stack of the calculator for the impressive programs

    HP 50 g has built in functions for these conversions, but more recent first HP does not work.

    All the best,

    Ziga

    And summarize the features of the program:

    Make a list of last wrote the number (one being 1: command):

    Make a matrix using a schema = {i, j} (a being list in 1: command):

    The array() function:

    EXPORT array()
    BEGIN
    LOCAL a, b, i, j;
    a: = years (1);
    (A) IF size == 1
    THEN
    b: = MAKELIST (years (X), X, a + 1, 2,-1);
    ON THE OTHER
    i: = a (1);
    j: = a (2);
    b: = MAKEMAT (years (i * j - J + 2-(I-1) * j), i, j);
    END;
    (b) return;
    END;

Maybe you are looking for

  • Cannot find unhidened apps.

    I recently show two Apps on my account, but can not find them anywhere.  Now, they're more in my assigned account hiden App, so. Where are they? He

  • How to cancel the print job with HP8610 Control Panel

    Is it possible to cancel a job using the control panel of the HP8610 instead of using the Task Manager?

  • I'm having a problem with XP Professional acquire an ip address from my local network.

    I just varies from att uverse to modom cable suppliers. The pc will be print to my network printer but not acquire to connect ti internet. My wife works at home online in this pc. I tried to reinstall the driver for the ethernet connection, but he on

  • 3 MAJOR problems with my rocket

    1. the converter converts, but my drive shows movies aren't supported formats. 2. all the memory cards I appear as having 0 free space, in spite of having a last night left of 900 MB. 3 new Music put on it does nothing. What is happening with it? It'

  • Windowss 10

    I tried to upgrade form Windows 7 SP1 to windows 10 5 times.  I get the following error code 0 x 80070057(2015/08/09-T-10-42-26A) can someone help me solve this problem