Dynamic calculation of diff. beween various months values

The requirement is: If the users input values for calmonths say, may'05 to aug'05, then the query will be able to calculate net value for four months (i.e it should be able to create 4 columns) and the diffence calculations from may'05(net value) - aug'05(net value) should be dynamic. Similarly, if it from say, june'05 to nov'05 then there will be six columns values dynamically and the diff bewteen values june'05 - nov'05 should be dynamic. How this can be achieved in BEX? Please give me some tips on this asap.

Hi,
You cannot achieve this directly.
Though, you can get some kind of approach:
Show all month in one columns and in another column – the difference between entered months. After clicking on calmonth (free char) you can get all individual columns for all month range, but difference calculated is wrong.
So, applying and removing drilldown you can switch a report between individual columns for months and all month in one column and a difference.
If this is suitable for you, I can provide more details.
Without doing some coding in VBA, I quess it’s the best you can achieve in query designer.
Best regards,
Eugene

Similar Messages

  • Dynamic calculation of prior 2 months

    Hi all
    Please help me out in solving this issue
    In my quuery out put will be as follows
    jun07 jul07 aug07 sep07
    quantity 45 50 60 70
    2m Offset quantity 45 50
    Issue:
    for 2m offset quantity we need to take quantity value two months prior.
    Example For sep07 it should display value of Jul07.
    I tried eith variable offset values. but they are taking current perid and substracting 2 months.
    i need dynamic calculation for every month.
    thanks
    srteelatha

    Hi,
    By Using 2 structures in the query , that means you have to take a selection in the columns area and you need to take 6 selections under this structure, you will get a chance to use the cell editor concept.Here first 2 selections will be hidden.
    that means first selection for APR.
    2nd selection for MAY.
    3 - June
    4- July
    5- Aug
    6- Sep
    In the cell editor concept ,you can overwriet the 2nd row values of the last 4 selections .That means 2nd row's 3rd(june) column value will be overwritten with  2nd row's 1st column value(APR) &
    2nd row's 4th column value(July) will be overwritten with  2nd row's 2ndt column value(May) &
    2nd row's 5th column value(aug) will be overwritten with  2nd row's 3rd column value(june) &
    2nd row's 6th column value(Sep) will be overwritten with  2nd row's 4th column value(July) &
    With rgds,
    Anil Kumar Sharma .P

  • Dynamic creation of single reports for characteristic value combinations

    Dear Experts,
    We have a report showing the monthly sales from one reporting unit (RU) to another u2013 see example below:
    RU 1, RU 2, Sales 100
    RU 1, RU 3, Sales 60
    RU 2, RU 1, Sales 20
    RU 2, RU 3, Sales 40
    There is a requirement to automatically generate single reports for each combination of RUs selling to each other and broadcast these reports automatically by mail:
    Report 1:
    RU 1, RU 2, Sales 100
    Report 2:
    RU 1, RU 3, Sales 60
    Report 3:
    RU 2, RU 1, Sales 20
    Report 4:
    RU 2, RU 3, Sales 40
    Of course it would be possible to create single reports for each combination using fixed filter values. But we need a dynamic calculation because there are not always sales for each combination.  Moreover this would be difficult to maintain, because each time a new reporting unit has been created, new reports have to be created as well. We are looking for a completely dynamic solution,
    Maybe there is a way to solve it with the BEx Broadcaster function u201Cprecalculation of value setsu201D or u201Cburstingu201D. But we unfortunately do not have any experience with this.
    Thanks a lot in advance for your help!
    Best regards
    Marco

    Hi,
    Using the bursting functionality in the broadcaster this is possible. I think you would want to send the reports from RU1 to RU2 and RU1 to RU3 to a recipient linked to RU1 or somehting. In that case you need to add an attribute email to the RU infoObject. In the bursting settings you can use that value to determine the recipient of the email. Furthermore, you can automatically split the resultset to receiving reporting unit.
    If you have any specific questions regarding this subject, let me know.
    Kind regards,
    Alex

  • Dynamic calculation of prior perod

    Hi all
    Please help me out in solving this issue
    In my quuery out put will be as follows
                            jun07    jul07    aug07  sep07
    quantity            45            50       60     70
    2m Offset quantity                          45        50
    Issue:
    for 2m offset quantity we need to take quantity value two months prior.
    Example For sep07 it should display value of Jul07.
    I tried eith variable offset values. but they are taking current perid and substracting 2 months.
    i need dynamic calculation for every month.
    thanks
    srteelatha

    Hi ,
    how are you getting the first 4 months? Is there one variable? Which one?
    Cornelia

  • Power Pivot - Calculating Exchange Rates depending on MONTH

    Hello everyone, I have a question, would like to know if someone can help me figuring out a solution. I have created a spreadsheet using powerquery and powerpivot. Loading the data on powerquery from different spreadsheets was a charm, the problem is calculating
    the exchange rates per month. Let me try to explain better;
    The structure is as following:
    I have 3 tables, they are:
    Dates– Just a dates (loaded directly on PowerPivot).
    Invoice – Details of invoices for all customers, gross totals are in different rates (loaded through power query)
    Customer – Detailed information of customers (loaded directly on PowerPivot).
    Currency – exchange rates (loaded directly on PowerPivot).
    Note: I mentioned where they were loaded because I do not know if that really matters, I guess it does not... but extra information will not hurt. Now, let's go to how these tables are connected between each other and their key columns:
    The Invoice table has information on invoices dates, invoice gross total and customer code. This table is related to Customer table, which has the actual name of customers and other details. This link is done through the Customer Code column. The Currency
    table have a relationship with the Customer Table through the Country Column.
    What I want to achieve is a formula to do the exchange rate based on the Invoice Date column present on the Invoice Table. So I have created a column on the Currency Table named at each month of the year and populated it with the exchange rates for all countries
    (countries listed using ISO3 format).
    My problem is while I am able to select a column from the Currency table to do the exchange rate calculation using the below formula, I fail to realize how to do it per month:
    =CALCULATE(sum(invoice[Gross Value])*SUM(Currency[Reverse]))
    *Reverse is the column with the exchange rate for the country money to USD
    What I am failing to do is how to make that calculation to also consider the month of the invoice and pull the exchange rate for the same month from the Currency table… something like:
    Get the invoice date then find the column on Currency[Month] and multiply, providing me the USD amount.
    I was unable to figure out a solution using the filters parameters from Calculate. If some of you ask why I am using SUM inside Calculate, is because if I only use SUM and try to do the math between the two tables I get an error saying that it was not possible
    to determine the value on Currency[Reverse]. Same happens with SUMX. It worked out with Calculate, but then I cannot create other formulas using CALCULATE on that table because it will give that error on redundancy, unless I add a filter on it, which worked
    last time (but I do not remember which thing /parameter used to filter, so do not ask it right now :D)
    To be honest… I do not really need that level of accuracy, but my Virgo perfectionist side demands me to find a solution to that, that will not use a single exchange rate, but consider which is the correct exchange rate for the month of the invoice and calculate
    it correctly for all invoices. Just so you know, the Invoices tables has more than 1million lines.
    Anyone know how to crack this problem or can point me to some site where I can learn how to do it?
    Thanks for the time reading all of this, even if you cannot help, I really appreciate it ;)

    Hi Estevao,
    Having problems to understand how you managed to combine your currency table with the customer table by Country ID. Where’s the 1-side of this relation (many customers in the same country and many months for the same currency)?
    Anyway: Seeing that you already use Power Query, I’d suggest that you prepare your data in a way that you can connect your currency table with your invoice table instead of with your customer table. Create a field in your Invoice Table
    that concatenates Customers CountryID&Month.
    Imke

  • Previous Month Value

    Hi,
    I have a couple of accounts that use the previous month value across years. However, sometimes it's necessary update the value in the middle of the year and this change should be reflected in the following months and years mantaining the old value in previous months and years.
    Somenthing like this:
    Year - FY12
    Jan- 100
    Feb- 100
    Mar- 100
    Apr- 100
    May- 100
    Jun- 100
    Jul- 100
    Aug- 100
    Sep- 100
    Oct- 100
    Nov- 100
    Dec- 100
    FY13
    Jan- 100
    Feb- 100
    Mar- 100
    Apr- 100
    May- 100
    Jun- 100
    Jul- 100
    Aug- 100
    Sep- 100
    Oct- 100
    Nov- 100
    Dec- 100
    If I change the value in November->FY12 to 200, I want:
    Year - FY12
    Jan- 100
    Feb- 100
    Mar- 100
    Apr- 100
    May- 100
    Jun- 100
    Jul- 100
    Aug- 100
    Sep- 100
    Oct- 100
    Nov- 200
    Dec- 200
    FY13
    Jan- 200
    Feb- 200
    Mar- 200
    Apr- 200
    May- 200
    Jun- 200
    Jul- 200
    Aug- 200
    Sep- 200
    Oct- 200
    Nov- 200
    Dec- 200
    Any help?
    Thanks

    I typically just aggregate up the Base + Adj to get "Total Adjusted". No need for a formula, unless you want to introduce specific override functionality. (Where the override amount would ignore what's in "Base" and "Adj") You may be able to get away with making "Total Adjusted" dynamic calc. This will depend on a lot of different factors, but it's something you should consider.
    Sometimes I put my adjustments into a separate form. Sometimes they're on the same form. That really depends on business requirements.
    Let's say you don't want to make this a separate dimension. Then the next option is typically creating specific adjustment accounts. The accounts where you're carrying the balance forward would look to see if an adjustment has been made in one of these specific adjustment accounts, and if so, add that adjustment to the prior value. I tend to prefer a separate adjustment dimension as it offers more flexibility, but if you've already got a database built, adding another dimension can be painful.
    - Jake

  • YTD Calculation based on 3 digit month?

    Hi,
    Using SSRS 2005 and my data source is a .CSV file where my date field is presented as Jan-2014.  I have two parameters for the report, Year and Month, where Year = 2014 and Month = Mar.
    I can get the selected month's data in the dataset by using Left and Right functions but I'm stumped as to how I can query the year to date calculations.  If I were working with actual dates I don't think it would be an issue but as far as I can
    tell Jan-2014 is not a valid date format.
    Any thoughts?
    Thanks in advance,
    Linn

    You can use this expression that converts what you get to regular date format (make sure it works for all month values as you receive them):
    =CDate("Jan-2014")
    Note that it converts to 1/1/2014 12:00 AM
    Then you can just use regular SQL query with it.
    Alternatively you can import .CSV file in staging database table using SSIS and work with that table.

  • Dynamic sql reurns no data when multiple values are passed.

    (Dynamic sql returns no data when multiple values are passed.)
    Hi,
    While executing the below dynamic sql in the procedure no data is returned when it has multiple input values.
    When the input is EMPID := '1'; the procedure works fine and returns data.Any suggestion why the procedure doen't works when input as EMPID := '1'',''2'; is passed as parameter?
    =======================================================
    create or replace PROCEDURE TEST(EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
    stmt VARCHAR2(9272);
    V_EMPID VARCHAR2(100);
    BEGIN
    V_EMPID :=EMPID;
    stmt := 'select * from TEST123 where Empid is NOT NULL';
    IF V_EMPID <> '-1' THEN
    stmt := stmt || ' and Empid in (:1)';
    ELSE
    stmt := stmt || ' and -1 = :1';
    END IF;
    OPEN rc FOR stmt USING V_EMPID;
    END Z_TEST;
    ============================================================
    Script for create table
    ==================================================================
    CREATE TABLE TEST123 (
    EMPID VARCHAR2(10 BYTE),
    DEPT NUMBER(3,0)
    ===========================================
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('1',20);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('2',10);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('3',30);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('3',30);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('2',10);
    =============================================
    Select * from TEST123 where Empid in (1,2,3)
    EMPID DEPT
    1     20
    2     10
    3     30
    3     30
    2     10
    ===================================================================
    Any suggestion why the procedure doen't works when input EMPID := '1'',''2';?
    Thank you,

    The whole scenario is a little strange. When I tried to compile your procedure it couldn't compile, but I added the missing info and was able to get it compiled.
    create or replace PROCEDURE TEST (EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
      stmt        VARCHAR2 (9272);
      V_EMPID     VARCHAR2 (100);
    BEGIN
      V_EMPID := EMPID;
      stmt := 'select * from TEST123 where Empid is NOT NULL';
      IF V_EMPID = '-1' THEN
        stmt := stmt || ' and Empid in (:1)';
      ELSE
        stmt := stmt || ' and -1 = :1';
      END IF;
      OPEN rc FOR stmt USING V_EMPID;
    END;If you pass in 1 as a parameter, it is going to execute because the statement that it is building is:
    select * from TEST123 where Empid is NOT NULL and -1 = 1Although the syntax is valid -1 will never equal 1 so you will never get any data.
    If you pass in 1,2 as a parameter then it is basically building the following:
    select * from TEST123 where Empid is NOT NULL and -1 = 1,2This will cause an invalid number because it is trying to check where -1 = 1,2
    You could always change your code to:
    PROCEDURE TEST (EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
      stmt        VARCHAR2 (9272);
      V_EMPID     VARCHAR2 (100);
    BEGIN
      V_EMPID := EMPID;
      stmt := 'select * from TEST123 where Empid is NOT NULL';
      stmt := stmt || ' and Empid in (:1)';
      OPEN rc FOR stmt USING V_EMPID;
    END;and forget the if v_empid = '-1' check. If you pass in a 1 it will work, if you pass in 1,2 is will work, but don't pass them in with any tick marks.

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • Dynamic form... field names and values...

    Boy-Howdy. I wish I had the opportunity to stop by this forum and hang out at a time when I am not having issue, but, alas... I appreciate the brain power of the great minds that populate this forum.
    I have an issue: I think I am close on this but cannot identify where my syntax is going awry. Here is a simplified edition of my situation.
    I have a form with a set of dropdown menus that filter a recordset. The group of drop downs are dynamic from a database and will vary depending on what category of products a visitor is viewing.
    If I browse to FRUIT: I get three options that let me filter for:
    Fruit Type
    - Apples
    - Bananas
    - Pears
    Fruit Grown By:
    - Organic
    - Any
    Fruit From:
    - Domestic
    - South America
    - European
    However, if I browse to LUMBER I get:
    Wood Type:
    - Pine
    - Walnut
    - Oak
    Wood Prep:
    - Pre Cut
    - RAW Timber
    Wood Origin:
    - North America
    - South America
    - Europe
    I have the variable naming and database values worked out. My only issue is when I browse to friuit and select apples I want apples to remain selected as I page through results.
    So, the dropdown field names are dynamic. Currently set to zgen1, zgen2, zgen3. I set a variable named sr and increment it to build the progressive 1,2,3 after the field name zgen.
    <cfparam name="sr" default="1">
    <cfoutput group="ft_id" query="oompa2">
    <strong>#f_ftrname#:</strong><br>
    <select name="zgen#variables.sr#">
    <OPTION value="">select...</OPTION>
    <cfoutput>
    <OPTION value="#ft_id#_#fs_id#">#ft_options#</OPTION>
    </cfoutput>
    </select>
    <br><br>
    <cfset sr=#sr# + 1>
    </cfoutput>
    But when zgen1 has a value (in this case "Apples") I can't figure out how to dynamically test for the presence of a value for each dropdown. I have dynamically created the field names (cfset xvalue="FORM.zgen#variables.sr#") to test against. However this creates a value of FORM.zgen1, FORM.zgen2, FORM.zgen3 as it loops when I want it to be Apples, Organic, Domestic.
    Example:
    The code:
    <OPTION value="#ft_id#_#fs_id#"<cfif xvalue IS "#ft_id#_#fs_id#"> SELECTED</cfif>>#ft_options#</OPTION>
    which is translating to:
    <OPTION value="15_5"<cfif FORM.zgen1 IS "15_5"> SELECTED</cfif>>Apples</OPTION>
    When I want it to be:
    <OPTION value="15_5"<cfif 15_5 IS "15_5"> SELECTED</cfif>>Apples</OPTION>
    I hope I am making sense. I would greatly appreciate it if someone could help me noodle this. I have a feeling it is not as complicated as my mind is trying to make it. Thoughts?

    Three selects related type code was not the way to go - because I need each filter to be independent. I created a custom tag that argues the state for each separately up to ten filters.

  • How to do dynamic calculation on PDF Form

    Hi friends,
    I need to to create a invoice page using Adobe PDF dynamic Form.
    Business Requirement:-
    1. User will select predifined product, Quantity, Rate and Amount would be calculated. Tax would be calculated from the below data.
    2. I have a  tax table
        0      - 1000    2%
        1000 - 2000   5%
        3000 - 4000   7%
    Queries:-
    - how to write script to calculate Tax based on above tax table data?  How to ref. a table data?
    - how to write script keeping in mind about adding new percentage in future?
    Cheers,
    Victor

    The attached form will help you in understanding the dynamic calculations.
    Reading the table data with changes in the future..
    a) If your application is a standalone application, (means you distribute the .PDF file directly to the users instead of rendering the PDF based on request), then you may need to hard code the data inside the form itself. - In this case, if the table data changes, you need to change the PDF and re-distribute the form.
    b) If you are rendering the PDF on the fly based on the request, then you have the option of reading the data from the table (you need to do this in the parent application which is invoking the rendering process) and make it part of the input XML at the time of rendering. You need to write your code to read the XML and do the calculations for each request. - In this case, if the table data changes, PDF will get the latest information beacause the latest info is available in the input XML.
    Thanks
    Srini

  • How to Bring the Quarter Period and Previous Month Value for given Input

    Hi to all,
          I want bring Quarter Period and Previous Month value for the given Input. Plz help me on this
    Example :
    Input : 06.2008
    Output:
    Input     Prev.Month  Quarter 1   Quarter 2   Quarter 3 
    06.2008  05.2008      03.2008     12.2007     09.2008
    12.2008  11.2008      09.2008      06.2008    03.2008
      Is there any Standad Exit for this or we have to write coding ?
    Regards,
    Saran

    Hi,
    You can solve this by using Replacement path.There you have a option offsets.Here give the current period.Based on that give the number which previouse month you suppose to want.
    I think this 'll help you
    assign points if this helps
    Regards
    JT Goud

  • BEx Analyzer bug in selection mask when selectin month values?

    Hi Gurus,
    I´m working with NW BI 7.0 and using BEx Analyzer 7.X (based on 7.20, Support Package 5, Revision 1776).
    In a query I want to do a selection within a selection mask for the Cal/Month variable (0Calmonth InfoObject).
    The values for months are appearing in correct order for example for the years from 2009 - 2011.
    But for the last three month values the year description appears always wrong.
    It shows always the year for the next years.
    Its like this:
    Jun 2009
    Jul 2009
    Aug 2009
    Sep 2009
    Oct 2010
    Nov 2010
    Dec 2010
    Jun 2010
    Jul 2010
    Aug 2010
    Sep 2010
    Oct 2011
    Nov 2011
    Dec 2011
    Jun 2011
    Jul 2011
    Aug 2011
    Sep 2011
    Oct 2012
    Nov 2012
    Dec 2012
    Is this a bug?
    The values are appearing correct in query results after selecting for example Dec 2012 and executing the query (Dec 2011 appears correct in query results).
    Thanks in advance.

    Thanks! I checked it, but the appearance of months and order is okay in T247.
    Any other ideas?
    I thought I read somewhere that this is a bug but can´t remember where I found that bug hint.

  • Urgent: Formular question: get first/last month value with qty value

    We've got a query result as the following:
    Jan_2007 -- Feb_2007 -- Mar_2007 -- Apr_2007
    0 --- 54 --- 0 --- 3
    23 ---0 --- 12 --- 7
    In the above query result,
    1st row shows the sales quantity in Jan_2007 is 0, in Feb_2007 is 54, in Mar_2007 is 0, and in Apr_2007 is 3.
    2nd row shows the sales quantity in Jan_2007 is 23, in Feb_2007 is 0, in Mar_2007 is 12, and in Apr_2007 is 7.
    We would like to add a new column to get the first/last month value with quantity, e.g., in 1st row, the 1st month value with quantity value (>0) is Feb_2007, and the last month value with quantity value (>0) is Apr_2007. Therefore the 1st month value with qty is Feb_2007 and the last month value with qty is Apr_2007. In 2nd row, the first month value with qty is Jan_2007 and the last month value with qty is Apr_2007. But how to use formular to get the 1st/last month values with qty?
    We will give you reward points!

    Hello Kevin,  
    You can create forumula using [Boolean Operator|http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm]
    IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
    You can also use the [AND, OR Logical operators |http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm]to check all the keyfigure columns.
    Thanks
    Chandran

  • Why customer exit variable to grab the current month value doesn't work?

    In CMOD, input the following code to grab the current month value from the system date:
    Grab the month value with System Date
    WHEN 'CURMONTH'.
        CLEAR l_s_range.
        l_s_range-low = SY-DATUM+4(2).
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
    In Query Designer, create a formula variable CURMONTH processed by customer exit and the dimension under the Currency/Unit tab is "Number".  Put the formular variable in the column as a KF.  When running the query, the column with the formular variable shows values of "2,0000000" other than just "2" I want for the current month.  If  the dimension under the Currency/Unit tab is "date", the column with the formular variable shows values of "00/00/0000".  Any idea?  How to grab the correct current month value which is 2 from the system date.
    Thanks!

    Oh ok , try the below options, As such I dont see any errors in our code .
    Not sure if you have ABAPER's in your team, just check with them once on the FM we are trying to see .
    Next , do you hvae 0CALDAY available in your report ? If so try to restrict that field with variable "0DAT" and write the same code you have written for your formula variable , but instead change the variable name to "0DAT" and try if this gets the month . let me know if I'm not clear .

Maybe you are looking for