Calcscript using variables, possible?

I have a calc that needs looking up a fixed cell each time, i.e
FIX("FY2009","January:December","Coke","Budget")
Sales_Revenue = Sales_Revenue * (1 + Sales->Actual->"West Region"->"Growth Rate%" )
END FIX
So "1 + Sales->Actual->"West Region"->"Growth Rate%" " is always fixed to a cell and I think the cross dim here is pretty inefficient to go outside. I dont want to grow the FIX statement (e.g. fixing on "West Region" either because I am applying to more regions.
So I am wondering if this could work? But its not working. Anyone?
Var Factor = 1 + (Sales->Actual->"West Region"->"Growth Rate%"->"Coke"->"FY2009"->"January" );
FIX("FY2009","January","Coke","Budget")
Sales_Revenue = Sales_Revenue * ( Factor )
END FIX
The idea is trying to get the factor in one quick pass, and then store that in memory and then run the formula without using any cross-dim that has to go out and back. But i cannot get it to work.
Edited by: user634643 on Aug 10, 2009 4:18 PM

A couple of thoughts:
1) Either you reference a block outside of your fix, or carry redundant info in every block. Take your pick and take your chances.
A) If you're storing a single value to use again and again, then this is your best bet: Sales->Actual->"West Region"->"Growth Rate%"->"Coke"->"FY2009"->"January" It is not in the calculated block (Actual versus Budget), but such is life -- it is stored once, read many times, and likely (likely, not for sure until you tune your Data Cache) in RAM, so what of it?
B) If you're storing different rates by month, then this is your best bet: Sales->Actual->"West Region"->"Growth Rate%" If Period is dense, you are still only reading one block, albeit many cells. Not an appreciable performance hit.
2) Your var statement doesn't work for two reasons:
A) vars can be declared outside of a member calc block (member name, left paren, logic, right paren), but must be valued within the member calc block. This is the "plain old doesn't work" bit.
B) Once A is satisfied, you are still going to reference the same number of blocks outside of your FIX. This is the "would be nice if it works, but unfortunately doesn't" bit.
3) Should "West Region" be in your FIX, or does it apply to all Regions?
4) Could you make your second approach work if it made sense to store the rate in Budget? You'd still have the issue of if it differs by Region, or by Period.
So, where to go?
I'd stick with your first code attempt unless of course you need it to go across Period. If you need the rate by month, go with the second. The FY2009 in the cross dims is redundant given the scope of the FIX, btw.
If you are set on using VAR, try this:
VAR varFactor
FIX("FY2009","January","Coke","Budget")
"Sales_Revenue"
varFactor = 1 + (Sales->Actual->"West Region"->"Growth Rate%"->"Coke"->"FY2009"->"January" ) ;
"Sales_Revenue" = "Sales_Revenue" * varFactor ;
END FIXPersonally, I would stick with your first approach.
Regards,
Cameron Lackpour
P.S. When I get confused about where my data is (which happens a lot, unfortunately), I take the equation out of the picture and try to just assign the complicated bit. If I can get one half of the equation right, then it's off to the next. It can be very difficult to id where data sits and if I'm not sure where multiple pieces of the puzzle are, I get confused. Just my $0.02.

Similar Messages

  • Text Variables - possible use metadata of the document itself?

    When using text variables, is it possible to pull the metadata from the document itself (as opposed to a placed image, etc.)?
    Thanks,
    Kristin.

    If the title of the document was the same as the file name, you could use variables:
    A second way is more manual. You could use the Section Marker field in Numbering & Section Options. You'd have to enter the title in the field. Then on the Master Page, place a text frame, and choose Type > Insert Special Character > Markers > Section Marker.
    Best,
    Steve

  • How to use variables with

    I need to get the number of lines in internal table, which would
    be easy, using DESCRIBE TABLE itab LINES lines. But the problem
    is, that I get the name of this internal table in the field of
    another internal table, so I have to use the name of internal
    table as variable, but I don't know how to use variables with
    DESCRIBE TABLE (or if this is possible).

    Hi,
    REPORT ZPRUEBA782 .
    define two tables with diferent structures.
    data: begin of table1 occurs 0,
    registro type i,
    end of table1.
    data: begin of table2 occurs 0,
    registro type i,
    repid like sy-repid,
    end of table2.
    data: rows type i.
    start-of-selection.
    fill them with data
    do 1000 times.
    table1-registro = sy-tabix.
    append table1.
    enddo.
    do 1757 times.
    table2-registro = sy-tabix.
    table2-repid = sy-repid.
    append table2.
    enddo.
    call a form that receives as input the table and returns the number
    of rows as output.
    perform howmanyrows tables table2 changing rows.
    break-point. "evaluate the number of rows
    perform howmanyrows tables table1 changing rows.
    break-point. "evaluate the number of rows
    end-of-selection.
    form howmanyrows tables itable changing rows.
    rows = 0.
    loop at itable.
    add 1 to rows.
    endloop.
    endform.
    You can try it if you don't find a better solution.
    Cheers,
    Chaitanya.

  • How to get a field that using variable in order to create a query

    Hi,
    I found a difficulty when creating a query. so, I would like to ask you some question.
    1. How to get a field that using variable which that field I want to put it in my query?
    For example, I would like to take quantity field in inventory audit report. And when I put my cursor in
    quantity field, there was only variable, item, etc. How to get this and put it in query?
    2. How to combined the invoice quantity with inventory audit report quantity?
    3. I have a query like this:
    SELECT distinct T0.[DocDate] as 'Tanggal', T0.[DocNum] as 'No.Faktur', T1.[ItemCode] as 'Kode Barang',
    T1.[Dscription] as 'Deskripsi', T1.[Quantity] as 'Quantity', ((T1.[LineTotal])/(T1.[Quantity])) as 'Harga
    Satuan', T1.[LineTotal] as 'Harga Total', T3.[CalcPrice] as 'HPP Satuan', ((T3.[CalcPrice]) * (T1.
    [Quantity])) as 'HPP Total', T4.[ItmsGrpNam] as 'Jenis Barang', T5.[SlpName] as 'Nama Sales', T1.
    [WhsCode] as 'Kode Gudang' FROM [dbo].[OINV] T0 INNER JOIN [dbo].[INV1] T1 ON T0.DocEntry =
    T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OINM T3 ON T2.ItemCode
    = T3.ItemCode INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod INNER JOIN OSLP T5 ON
    T0.SlpCode = T5.SlpCode WHERE T3.[TransType] = '13' and T3.[CreatedBy] = T1.[DocEntry] and T0.
    [DocDate] >=[%0] and T0.[DocDate] <=[%1] and T4.[ItmsGrpNam] =[%2] and T1.[WhsCode] =[%3]
    Is it possible if I just take one invoice with invoice quantity and only show up at once although I have a
    lot item cost for that item? (because I'm using FIFOmethod).
    Please help me.. cause I'm stuck with this thing :l.
    Thank you very much, and I'm waiting your respon soon.
    Regards,
    Sisca

    Try this one:
    SELECT distinct T0.DocDate as 'Tanggal', T0.DocNum as 'No.Faktur', T1.ItemCode as 'Kode Barang',
    T1.Dscription as 'Deskripsi', T1.Quantity as 'Quantity', ((T1.LineTotal)/(T1.Quantity)) as 'Harga
    Satuan', T1.LineTotal as 'Harga Total', T3.CalcPrice as 'HPP Satuan', ((T3.CalcPrice) * (T1.
    Quantity)) as 'HPP Total', T4.ItmsGrpNam as 'Jenis Barang', T5.SlpName as 'Nama Sales', T1.
    WhsCode as 'Kode Gudang'
    FROM dbo.OINV T0 INNER JOIN dbo.INV1 T1 ON T0.DocEntry =T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OINM T3 ON T2.ItemCode = T3.ItemCode AND T3.TransType = '13' and T3.CreatedBy = T1.DocEntry AND T3.Warehouse = T1.WhsCode
    INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod
    INNER JOIN OSLP T5 ON T0.SlpCode = T5.SlpCode
    WHERE T0.DocDate >=[%0\] and T0.DocDate <=[%1\] and T4.ItmsGrpNam =[%2\] and T1.WhsCode =[%3\]
    Thanks,
    Gordon

  • How can I use variable name as a prameter value in HOST Command ???

    Hi All,
    How can it possible to use variable value in parameter in HOST command ??
    Following in my code:
    host('rwclient server=reptest report=c:\cust_print.rdf p_1= s_sam_cust_id userid=wh1/wh1@dwh desformat=pdf desty=file desname=c:/temp/'||v_sam_cust_id||'.pdf');
    Regards

    Hello,
    The Syntax of the builtin HOST is :
    SyntaxPROCEDURE HOST
    (system_command_string VARCHAR2);
    PROCEDURE HOST
    (system_command_string VARCHAR2,
    screen_action NUMBER);
    So , you can build the system_command_string as any VARCHAR2
    Example are provided in online help :
    http://www.oracle.com/webapps/online-help/forms/10g/topics/f1_help/builth_m/host.html?tp=true
    Regards

  • Retrieve the message put in message header using variable substitution

    hi,
    i am using dynamic configuration to put some information in the message header.is it possible to retrieve the message using variable substitution and if it is possible then how it be done using variable substitution.
    regards,
    Meenakshi

    Variable Substitution does not allow you to read all the messaeg header elements only some of them can be read/ access....for more info on how to read the message header elements refer: /people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
    From the above blog:
    When using Variable Substitution, only certain standard message header attributes can be used/accessed (e.g. sender_party,
    sender_service, receiver_party, receiver_service, interface_name, interface_namespace, message_id)
    Better use Dynamic Configuration to read the parameters.
    I am wondering why you need to read the message header parameters when you are putting them using Dynamic Configuration.....cant you just get the details from the dynamic configuration UDF itself?
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Dec 10, 2009 1:18 PM

  • Different files using variable substitution

    Hi,
    I've one scenario in which I'll be getting information like below
    Cust_Data      1..1
    VKORG          0..unbounded
         KUNNR      1..1
         NAME1      0..1
         LAND1      0..1
    now I am supposed to create various files containing customer data containing kunnr, name1, land1 only for each of VKORG
    I've tried using variable substittuion, in which i've given follwing information
    File Name Scheme : Customer_for_%vkorg%.txt
    Variable name                    Reference
    vkorg                                  payload:Cust_Data,1,VKORG,1
    but by providing this information, I am getting only one file having all the customer records.
    So My question is:
    1. How do I create different files for each of different VKORG
    2. How do I place customer data only pertaining to that VKORG only.
    Thanks,

    Go for 1:n multi-mapping. For details, you can refer to /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible and /people/ranga.rajan2/blog/2010/03/17/multi-mapping-with-a-simple-scenario--fledgling-kit .
    Regards,
    Sunil Chandra

  • Using variables in transform process

    Using file adapter to read multiple rows into the database. Its a basic transformation with a one to one match, e.g. what's on the left exist on the right.
    The issue is that I want to uniquely identify each file process with an ID. Therefore what I have done is set up a sequence which will be used as a batch ID. I assign this to a variable before I transform the file definition to the database definition.
    What I would like to do is assign this variable to a field in my database as a kind of dynamic constant. I don't seem to be able to use the getVariableData in the options. I want this ID to be loaded on every line without incrementing.
    Does anyone know if it is possible to use variables within the transformation.
    cheers
    James

    Using file adapter to read multiple rows into the database. Its a basic transformation with a one to one match, e.g. what's on the left exist on the right.
    The issue is that I want to uniquely identify each file process with an ID. Therefore what I have done is set up a sequence which will be used as a batch ID. I assign this to a variable before I transform the file definition to the database definition.
    What I would like to do is assign this variable to a field in my database as a kind of dynamic constant. I don't seem to be able to use the getVariableData in the options. I want this ID to be loaded on every line without incrementing.
    Does anyone know if it is possible to use variables within the transformation.
    cheers
    James

  • Using Variable in place of property name in set_item_property procedure.

    Hello,
    I need to change the item properties dynamically by using variables for both properties names and their values.But during compilation its showing me error "Too many declrations".Kindly suggest me any best way.

    You already have the answer to that one in the posting above.
    Your table would presumable include rows HEIGHT, WIDTH etc.. as text columns
    So you'd cross reference as above.
    Alternatively you could find out what the numerical values are for HEIGHT (1509) and WIDTH (1508) are and store them in your master table alongside the description that your user will see. Then you can simply do the set_item_property.
    This relies heavily on Oracle not changing the values for these constants. Even if they did you would just have to change your table. Then your solution is generic and future proof.
    Built in for all properties: Not that I know of. But you could sort of use your table as above to help. Simply loop through the constants, do a get_item_property, and show that to the user.
    You'll have to be careful about maybe classifying the things in your table to ensure you don't try to get an inappropriate property for the type of item.
    With a little effort this will all definitely be possible.
    I saw a thread the other day where someone had created a form called "props.fmb" which showed the item properties in a tree style. See if you can find that. This was fairly hard coded compared to what you want, but it would be pretty good as a basis.

  • Using variables in a jsp:useBean tag

    I was wondeing if it is possible in any way to use variables in a jsp:useBean tag. Here is an example of what I am trying to do.
    <%
    String beanType = request.getParameter( "bean" );
    if( beanType.equals( "Bean1" ) ) {
    beanClass = "com.myCompany.Bean1";
    } else {
    beanClass = "com.myCompany.Bean2";
    %>
    <jsp:useBean name="<%= beanType %>" class="<%= beanClass %>"/>
    I also tried using this approach
    <%
    if( beanType.equals( "Bean1" ) ) {
    %>
    <jsp:useBean id="bean" class="com.myCompany.Bean1"/>
    <%
    } else if( beanType.equals( "Bean2" ) ) {
    %>
    <jsp:useBean id="bean" class="com.myCompany.Bean2"/>
    <%
    %>
    Neither approach seems to work. Is there any way around this problem?
    Thanks,
    Marcus.

    Hi,
    check:
    http://forum.java.sun.com/thread.jsp?forum=45&thread=398998&tstart=75&trange=15

  • Can I use variables in mxml tags?

    I want to control a lot of details in a layout.  I need to use variables to do this.  Of course I can use AS.  Is there a way to do it in the MXML tags?  See the code below.  I can do the "myLine.x = lineX" in AS.  But is there something like:  x="{lineX}" to use in a tag?  (This gives a warning, though it does work.)  It would make life faster if I could...   Is there a "right" way to do this?
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   initialize="init()" >
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                internal var lineX:Number = 25;
                private function init():void {
                    myLine.x = lineX + 50;       
            ]]>
        </fx:Script>
        <s:Line id="myLine" xFrom="0" xTo="0" yFrom="50" yTo="300" >
            <s:stroke>
                <s:SolidColorStroke color="0x0000ff" weight="2" />
            </s:stroke>
        </s:Line>
        <s:Line id="myOtherLine" x="{lineX}" xFrom="0" xTo="0" yFrom="50" yTo="300" >
            <s:stroke>
                <s:SolidColorStroke color="0xff0000" weight="2" />
            </s:stroke>
        </s:Line>
    </s:Application>

    Hmm, thanks, that's very useful to know.
    I guess that means I should use AS.  It's not something I need to update often.  Rather, I have a whole bunch of groups of components/graphics that I want to line up based on each other--and when I change my mind about the size or position of one thing (possibly inside a container a level or two), I'd like to be able to just change one variable name rather than have to change them all by hand.  But AS can do it just fine.

  • Using variables in Caption section of Legend Answers view

    Is it possible to use variables as Captions in the Legend Answers view? If so, what's the format? Thank you

    Thank you for the link - i believe this is covered in docs, however, I wasn't able to get the result I wanted by using any of the variable strings. I'm just getting the string variable output along with my variable name. I should have mentioned that I've tried this before. You know which part I'm talking about right? When you go to Legend , then select caption. I still marked answer as helpful.

  • Using variables in Page processing

    I want to use variables (items) in
    Page processing - process - reset pagination for page(s) (PageID,PageID,PageID)
    and
    Page processing - Branches - Branch to page / URL - URL
    Is this possible, and if so How
    Fred.

    scott,
    On the places I mentioned I have tried to use references like &ITEM. and #ITEM# but they don't work.
    Where can I find documentation about where I can use which references.
    Fred.

  • Using  variables in etext template

    Hello All,
    I have a requirement where in I have to print totals in each trailer of a batch. I have to do totals only for a particular set of records.
    For doing sum there is a value column under each outboundpayment record. say /payment/value
    Output contains the following
    header
    body
    trailer
    for each batch the above 3 will be repeated .
    say for batch 01 there will be a header, 2 records in the body and 1 record in the trailer section. Now in the trailer section I have to print sum only for batch 01.
    When Iam doing sum(payment/value) it is printing the sum of all the batches as there is no condition while doing sum.
    outboundpaymentinstruction
    outboundpayment - 01
    outboundpayment - 01
    outboundpayment - 03
    outboundpayment - 03
    outboundpayment - 04
    outboundpayment - 04
    outboundpaymentinstruction
    Can anyone provide some guidance. Is there a possibility of using variables ?
    Regards,
    Swetha

    The pop-up menus you mention are not DW Template compatible.
    It's a good
    thing, really. Read this -
    http://www.losingfight.com/blog/2006/08/11/the-sordid-tale-of-mm_menufw_menujs/
    There are MUCH better ways -
    Check the uberlink and MacFly tutorials at PVII -
    http://www.projectseven.com/
    and the Navbar tutorial/articles at Thierry's place
    http://tjkdesign.com/articles/dropdown/
    Or this one (more recent article):
    http://tjkdesign.com/articles/Pure_CSS_Dropdown_Menus.asp
    Or to get it done fast, go here -
    http://www.projectseven.com/tutorials/navigation/auto_hide/index.htm
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "BezierBoy" <[email protected]> wrote in
    message
    news:fpsq3u$3mq$[email protected]..
    >I was about to post a similar question.
    >
    > I've been trying to build a template that includes
    navigation buttons that
    > will contain mouse-over behaviors, specifically pop-up
    menus. I can
    > successfully build the page as html, but when I try to
    build it as a
    > template,
    > the "Show Pop Up Menus" selection in the behaviors panel
    is grayed-out.
    >
    > What am I missing? I'm on a Mac running DW MX.
    >
    > Thanks,
    >
    > Jim
    >

  • Using variables in Business Rules

    Hello Experts,
    Do you know if it's possilble to declare (and use) text variables in Business Rules?
    I want to do some strings treatment (concatenation, substring) and I need to use variables.
    Regards,
    Rodrigo

    Hi,
    thanks for your answers.
    But without variables I don't know if it's possible to do the following:
    I have a member dimension (that is from text type) and I want to access to it's content and, with some string treatment, reach to a member that I will FIX.
    How can I access to the content of the text dimension member?
    I give you the example:
    Let's supose that the name of the text dimension member is TEXTMEMBER.
    For Example if I use @SUBSTRING("TEXTMEMBER", 0, 3).
    If I write the member like the above I'm not reaching to the content of dimension member....
    Do you know how to do this?
    Regards,
    Rodrigo

Maybe you are looking for