Assigning value bands to calculated numbers

Hello again,
I have an extension question to my earlier thread "Assigning value bands to numbers". I'm now trying to assign value bands to a calculated field REV_NET_PER_SITE. Here is my SQL statement by I'm getting an error "JOIN expression not supported".
SELECT REV_BY_ACCT.GLSeq, Count(REV_BY_SITE.SITE_ADDR_ID) AS NUM_SITES, REV_BY_ACCT.SGMNT1, REV_BY_ACCT.SGMNT2, REV_BY_ACCT.PERIOD, REV_BY_ACCT.RECUR, REV_BY_ACCT.PROMOTED, IIf(NUM_SITES > 0, REV_BY_ACCT.SumOfREV_GRS/NUM_SITES, REV_BY_ACCT.SumOfREV_GRS)
AS REV_GRS_PER_SITE, IIf(NUM_SITES > 0, REV_BY_ACCT.SumOfREV_NET/NUM_SITES, REV_BY_ACCT.SumOfREV_NET) AS REV_NET_PER_SITE, LOOKUP_VALUE_BAND.ALIAS
FROM (REV_BY_ACCT INNER JOIN REV_BY_SITE
ON REV_BY_SITE.GLSeq = REV_BY_ACCT.GLSeq
AND REV_BY_SITE.PERIOD = REV_BY_ACCT.PERIOD
AND REV_BY_SITE.LOB = REV_BY_ACCT.LOB)
INNER JOIN LOOKUP_VALUE_BAND
ON REV_NET_PER_SITE >= LOOKUP_VALUE_BAND.LB
AND REV_NET_PER_SITE <= LOOKUP_VALUE_BAND.UB
WHERE (REV_BY_ACCT.SGMNT1="Small" 
Or REV_BY_ACCT.SGMNT1="Medium")
AND REV_BY_ACCT.PERIOD>#12/31/2013#
AND REV_BY_ACCT.RECUR=Yes
AND REV_BY_ACCT.PROMOTED=Yes
AND REV_BY_ACCT.SumOfREV_NET<>0
GROUP BY REV_BY_ACCT.GLSeq, REV_BY_ACCT.SGMNT1, REV_BY_ACCT.SGMNT2, 
REV_BY_ACCT.PERIOD, REV_BY_ACCT.RECUR, REV_BY_ACCT.PROMOTED, 
REV_BY_ACCT.SumOfREV_GRS, REV_BY_ACCT.SumOfREV_NET, LOOKUP_VALUE_BAND.ALIAS;
"REV_BY_ACCT" is a query that aggregates revenue by account. NUM_SITE is numbers of sites per account (i.e., "GLSeq" field) calculated from "REV_BY_SITE" query that has revenue by SITE.
In the query above, I've calculated REV_NET_PER_SITE as "REV_BY_ACCTagg.SumOfREV_NET/NUM_SITES".
Appreciate for the help getting this query right.
Regards,
Asif

Hi Asif,
To reproduce your problem easily, I recommend that you upload your sample database in
OneDrive.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Assigning value bands to numbers

    Hi there,
    I want to write a query to assign value bands to revenue. Here is the value bands table that I have:
    I tried to use a DLookup function as follows:
    COMB_VALUE_BAND: DLookUp("[Alias]","LOOKUP_VALUE_BAND",[REV_NET]>=[LB] And [REV_NET]<=[UB])
    Needless, it does not work. What should I do?
    Many thanks for help.

    Here are the values in LOOKUP_VALUE_BAND.
    VB
    LB
    UB
    Alias
    A
    0.00
    700.00
    VB1
    B
    700.00
    1,100.00
    VB2
    C
    1,100.00
    1,500.00
    VB3
    D
    1,500.00
    1,900.00
    VB4
    E
    1,900.00
    VB5
    That's not going to work.  The lb values must be distinct from the uv values, i.e. each of the latter must be greater than the former, e.g.
    A          0.00       700.00    VB1
    B       700.01    1,100.00     VB2
    and so on
    And the final row:
    E    1,900.01                     VB5
    should have an artificially high value in the ub column.
    Ken Sheridan, Stafford, England

  • How "Assigned" value calculated for WBS in CJ30?

    Dear all,
    I have got a problem with the Assigned value in CJ30. The problem is that the value in column "Assigned" of CJ30 disappeared after I settled the cost of the WBS to another WBS which has no budget control activated (no budget profile assigned). As I know, the Assigned value won't be changed if the WBS is settled to an object with no budget control, for example settle the WBS to a cost center, or a assets. In my case, although the settlment was done between two WBS, but I had removed the budget profile when created the receiver project, which means the receiver WBS has no budget control activated. However, after settlement, the assigned value of the sender WBS disappeared. But if I settle the cost to a cost center or assets, I can see the assigned value still shown on the sender WBS in CJ30.
    Can anybody here tell me why this happen? or is this a bug of SAP?
    Thank you very much in advance.
    Best regards,
    Brook

    I can reproduce your issue.  If you toggle open Audience P I think you will find the very last value for the last Category and the last Product_Group will be around 15% for Growth 2014 and around 23% for Growth 2015.  The chart series expression
    is choosing the last value for ReportItems!YoYGrowthPercentage as it doesn't know how to attribute that ReportItem to the Audience matrix.  If you want a chart to display only the percentage for Audience, I suggest that you have a separate data
    source with the values for GrowthPercentage for only the Audiences, and make that the data source for your chart. Also, I would make the growth figures in your matrix also a matrix by doing the percentage calculation directly in the table. You would pull in
    the value for this year and the value for last year into your data set, and then do the calculation within the report as follows:
    =SUM(Fields!Value.Value)/Sum(Fields!LastYearValue.Value)-1
    Create a second Column Group adjacent after, also by year.  Your query could look something like this, depending on how your tables are structured:
    SELECT a.Audience, a.Category, a.ProductGroup, a.Year, a.Value, b.Year as LastYear, ISNULL(b.Value,0) as LastYearValue
    FROM YoYGrowth a LEFT OUTER JOIN
    YoYGrowth b ON a.Audience = b.Audience and a.Category= b.Category and a.ProductGroup = b.ProductGroup
    AND a.Year-1 = b.Year
    Hope it helps.  Cheers,
    Martina White

  • Assign value to result through FM in Update routine

    Hi experts,
    I have wrote a simple FM which adds two numbers. How can I add the result of that FM in update routine. Basically, how do I assign value to RESULT.
    CALL FUNCTION 'ZTEST_ABC'
      EXPORTING
        I_NUM1        = 10       (first input)
        I_NUM2        = 20        (second input)
    IMPORTING
       I_NUM3        =               (is addition of inputs)
    result value of the routine
      RESULT = .       (How to assign it to result)

    CALL FUNCTION 'ZTEST_ABC'
    EXPORTING
    I_NUM1 = 10 (first input)
    I_NUM2 = 20 (second input)
    IMPORTING
    RESULT = INUM3.

  • Assigning value to array type variable in a loop

    Hi
    I have a scenario in which i am assigning value from a array type variable(x) to the invoke variable of a database adapter. The variable x is exact replica of the invoke variable.
    My copy operation in assign activity looks like this-
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters"/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    </copy>
    It is inside a while loop activity.
    PS *()* are square brackets
    But it is erroring out at run time.
    Does anybody has an alternate idea to assign value to an array type?.
    i have seen that while extracting value from an array type variable it works fine
    A similar kind of operation is shown below.
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters"/>
    </copy>
    Thanks
    Ayush
    Edited by: Ayush fujitsu on Aug 14, 2009 4:36 AM

    Hi Ayush
    I suppose you are getting some error like "source node returns multiple elements".
    In second case there is no problem because you are assigning *InputParameters[bpws:getVariableData('iterator')]* (+suppose InputParameters[1]+) to target. Here it works fine because you are fetching oonly 1 value from source and assigning it to the target.
    Now in first case you are saying copy InputParameters to target[1] suppose. You know that source is an array which contains multiple index so which index field from the source will be assigned to the target.
    Try your process with only 1 source value it will work but when multiple values will be there it will fail. You have to merge both the cases and it will look like
    *<copy>*
    *<from variable="Var" part="InputParameters"*
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"*
    part="InputParameters"
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *</copy>*
    And the easiest way to do this is by the transform activity as said above.
    Regards
    Suryaveer
    Edited by: Suryaveer on Aug 15, 2009 11:19 PM

  • BP Transaction : Assign values to fields upon selection of BP role ?

    Hi All,
    I want to assign values to Grouping and Account Group fields in BP transaction in CRM.
    Is there any BADI or Userexit to achive the same. If possible kindly explain the steps to be implemented to use the BADI.
    Thanks & Regards,
    Navneeth K.

    Hi Navneeth,
    There are 2 ways to approach this :
    1. You can create an application transaction for the standard transaction BP. This will open the transaction in whichever role you require, default a groupng, and allow you to control some other initializaittion parameters. This is very similar the transaction variant mentioned above by Adil.
    You can explore 'Application Transactions' through SPRO->Cross Application>SAP Business Partner-> Business Partner> BAsic Settings>Business Partner Roles>Define Application Transactions.
    2. To default grouping , you can use BADI BUPA_NUMBER_GROUP. THe BADI will receive the list of groupings that will be shown in the dropdown .Write the implementation so as to remove unwanted groupins and keep only the number groupig you wish to default.
    Hope this helps.
    Cheers,
    Rishu.

  • Can we assign value to a variable in PL/SQL Loop

    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????
    Thanks & Regards,
    Hari Babu
    Edited by: 1004977 on Jun 5, 2013 2:40 AM

    Hi,
    1004977 wrote:
    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????Yes; the example you posted does that.
    When the loop starts, the value 10 is assigned to v_num. You should see that value displayed by the put_line statement.
    After that, v_num is set to 10 - 1 = 9.
    Next, the EXIT condition is evaluated. At this point, v_num is 9, not 0, so the loop runs again. V_num is set to 10 again, and the loop continues forever (or, in some versions, until the dbms_output buffer is filled and an error occurs.)

  • Assign value to a record in a loop?

    I have the record as following:
    TYPE Curr_Select_Rec IS RECORD
    ser_date date,
    blk_route varchar210)
    p_select Curr_Select_Rec;
    How do I assign value to it in a loop?
    I know I can do this
    p_select.blk_route := 'aaaa';
    but in the loop
    Loop
    How??????
    end loop;
    NEXT, LAST, FIRST Did not work
    null

    Hi,
    here a little package I wrote to select a table into a plsql_table and to work with the pl/sql table .
    Package STIL_utils
    IS
    type r_export_tags is record
    (bezeichnung stilvorlagen.bezeichnung%TYPE,
    start_tag stilvorlagen.text_beginn%TYPE,
    end_tag stilvorlagen.text_ende%TYPE);
    type t_export_tags is table of r_export_tags
    index by binary_integer;
    procedure fill_tag_table(p_export_tags in out t_export_Tags,
    p_export_typ in varchar2);
    procedure show_tag_table(p_export_tags in t_export_Tags);
    procedure find_tag(p_export_tags in out t_export_tags,
    p_export_typ in varchar2,
    p_tag_typ in varchar2,
    p_start_tag in out stilvorlagen.text_beginn%TYPE,
    p_end_tag in out stilvorlagen.text_ende%TYPE);
    END; -- Package Specification UTL_STIL
    Package Body STIL_utils
    IS
    -- Stilvorlagen Array
    procedure show_tag_table(p_export_tags in t_export_tags)
    is
    v_index number;
    v_index_last number;
    begin
    v_index := p_export_tags.first;
    v_index_last := p_export_tags.last;
    loop
    dbms_output.put_line(p_export_Tags(v_index).bezeichnung);
    dbms_output.put_line(p_export_Tags(v_index).start_tag);
    dbms_output.put_line(p_export_Tags(v_index).end_tag);
    exit when v_index = v_index_last;
    v_index := p_export_Tags.next(v_index);
    end loop;
    end;
    procedure fill_tag_table(p_export_tags in out t_export_Tags,
    p_export_typ in varchar2)
    is
    cursor tags is
    select bezeichnung,text_beginn,text_ende
    from stilvorlagen
    where bezeichnung like p_export_typ&#0124; &#0124;'_%'
    and loesch_kz is null;
    v_count number := 0;
    --Prozedur zur Ermittlung welche Tags verwendet werden sollen.
    -- Aus der Tabelle Stilvorlagen wird ein Array mit den Start und
    --Ende Tags des entsprechenden Export Typs gef|llt.
    begin
    for rec in tags
    loop
    p_export_tags(v_count).bezeichnung := rec.bezeichnung;
    p_export_tags(v_count).start_tag := rec.text_beginn;
    p_export_tags(v_count).end_tag := rec.text_ende;
    v_count := v_count + 1;
    end loop;
    --show_tag_table(p_export_tags);
    end;
    procedure find_tag(p_export_tags in out t_export_tags,
    p_export_typ in varchar2,
    p_tag_typ in varchar2,
    p_start_tag in out stilvorlagen.text_beginn%TYPE,
    p_end_tag in out stilvorlagen.text_ende%TYPE)
    is
    v_index number;
    v_index_last number;
    v_bezeichnung stilvorlagen.bezeichnung%TYPE;
    begin
    v_index := p_export_tags.first; --Arrayindex setzen
    v_index_last := p_export_Tags.last; --Abbruchkriterium ermitteln
    p_start_tag := null;
    p_end_tag := null;
    loop
    v_bezeichnung := p_export_tags(v_index).bezeichnung;
    -- Ist das der richtige Tag?
    if v_bezeichnung = p_export_typ&#0124; &#0124;'_'&#0124; &#0124;p_tag_typ then
    p_start_Tag := p_export_tags(v_index).start_Tag;
    p_end_Tag := p_export_tags(v_index).end_Tag;
    -- Tag gefunden also raus
    exit;
    else
    -- Wenn alle getestet, dann raus
    exit when v_index = v_index_last;
    -- Ndchstes Feld aus Array
    v_index := p_export_Tags.next(v_index);
    end if;
    end loop;
    end;
    END; -- Package Body UTL_STIL
    Hope that helps
    Detlev
    null

  • How can i assign value to the certain field in dynmic table ?

    i have created a dynmic table .now i want to assign value to the certain field,how can i do that?
    for eg,
    <dyn_table> contains fields of  name age ,now i want assign 'jack' to this internal talbe's field name ,

    Hi,
    try this:
    FIELD-SYMBOLS: <GT_ITAB>      TYPE TABLE,
                   <GS_ITAB>,
                   <FS>, <FS1>.
    DATA: GT_DATA   TYPE REF TO DATA.
    DATA: GS_DATA   TYPE REF TO DATA.
    START-OF-SELECTION.
      CREATE DATA GT_DATA TYPE TABLE OF PA0002.
      ASSIGN GT_DATA->*   TO <GT_ITAB>.
      CREATE DATA GS_DATA    LIKE LINE OF <GT_ITAB>.
      ASSIGN GS_DATA->*      TO <GS_ITAB>.
      ASSIGN COMPONENT 'NACHN' OF STRUCTURE <GS_ITAB> TO <FS>.
      <FS> = 'Smith'.
      ASSIGN COMPONENT 'VORNA' OF STRUCTURE <GS_ITAB> TO <FS>.
      <FS> = 'Paul'.
      APPEND <GS_ITAB> TO <GT_ITAB>.
      ASSIGN COMPONENT 'NACHN' OF STRUCTURE <GS_ITAB> TO <FS>.
      <FS> = 'Jones'.
      ASSIGN COMPONENT 'VORNA' OF STRUCTURE <GS_ITAB> TO <FS>.
      <FS> = 'Martin'.
      APPEND <GS_ITAB> TO <GT_ITAB>.
      LOOP AT <GT_ITAB> INTO <GS_ITAB>.
        ASSIGN COMPONENT 'NACHN' OF STRUCTURE <GS_ITAB> TO <FS>.
        ASSIGN COMPONENT 'VORNA' OF STRUCTURE <GS_ITAB> TO <FS1>.
        WRITE: / <FS>, <FS1>.
      ENDLOOP.
    Regards, Dieter

  • Dynamically assign value to a column in ALV LIST Display

    Hi all,
    How can I dynamically assign value to a column in ALV LIST Display without using classes and methods?
    Thanks,
    Ridhima

    Hi Vikranth,
    I am displaying one ALV list say with columns A and B.
    I have value in A but not in B. Now at runtime user selects one row, clicks on push button in application toolbar, then i have to display value in column B in the already displayed list.
    I searched and came to know it can be done with oops concept. but i am not using classes and methods.
    so how can i do this?
    Thanks,
    Ridhima.

  • Assigning value to variable in ODI

    Hi
    TotalCount(datatype is numeric)--->Action is (Latest value)
    And i want to assign value it by using following query
    select count(*) from Investment_ato
    i am writing this in a refresh tab
    And i am using this variable in another variable(var_account)
    but value of TotalCount variable is not coming in var_account
    so plz suggest regards the same
    thanks

    You can set the refreshing mode in the variable var_account and in the refreshing tab put the query as: select #TotalCount from dual.
    Hope it helps!

  • Assigning value to an item

    Is there a way to assign value to variable
    of data type ITEM? In other words, I need to
    assign value to an item, where I just know the
    it_id.
    In the following procedure p_item is unknown until runtime;
    and if it_id is not null then assign some value to the item.
    procedure update_item(p_item)
    is
    it_id item := find_item('block1.'||p_item);
    if not id_null(it_id) then
       it_id := 'some_value';  --doesn't work.
    end if;
    end;

    Do you mean you know the name of the item and you want to then assign a value?
    If so then use the COPY command which allows you to assign a value to a named variable
    e.g.
    COPY (12345, 'blocka.number_item1');
    To read the value in the same way use the NAME_IN function.
    There is plenty in the forms helps about this.
    Mark

  • Assigning value to an input account

    Hi,
    We have an input account in our Account dimension. In the rule file (maybe in the consolidation routine) can we write a code which assigns a value to an input account. The assigned value maybe another account value or a static value based on a logic.
    Thanks

    If by "input account" you mean a leaf-level account that has no children, the answer is "yes", but with a qualification. In normal circumstances, for the rule to post the value to the account it needs to have the "IsCalculated" parameter set to "Y". This means the account can no longer have data posted to it via FDM, grids or forms.
    The other possibility is the use of allocation functions &/or routines but this is an area I have not explored personally in HFM.

  • Assigning Value To An Application Item via JS

    Hi guys,
    I am trying to assign a value to an application item by using javascript. But I can't do this when I try to display with alert the result is empty. Do you have any idea how can I assign value to an application item by using javascript?
    else if(action=="ASSIGN")
    var moname = $(el).children("td[headers='SOURCE']").text();
    $s('F10_SELECTED_OBJ',moname);
    alert($v('F10_SELECTED_OBJ'));
    Thanks

    Hi
    >
    I am trying to assign a value to an application item by using javascript. But I can't do this when I try to display with alert the result is empty. Do you have any idea how can I assign value to an application item by using javascript?
    >
    Scope of JavaScript is the HTML DOM in the browser. The Application Items do not exist in the HTML DOM, only in the session state.
    This explains what you observer. To set the App Items using JS you have to use an AJAX call to an OnDemand Application Process that sets the Application Item using PL/SQL. Or, call a procedure over http and set the App Item in that procedure after setting the Workspace / Security Group Id.
    Regards,

  • Assigning value to field in proxy report

    Hello,
    I am writing the abap report for sproxy.
    The link to the field in structure is very long.
    e.g. it-fault_message_mt-request-calldata-requester-gid = 'Z12345'.
    In the structure one field in calldata is ADDITIONAL_ATTRIBUTE which is of table type.
    I want to assign values to the fields of ADDITIONAL_ATTRIBUTE.
    When I click on field ADDITIONAL_ATTRIBUTE we can see line type ZFAULT_MESSAGE_ADDITIONAL_ATTR and this line type is having NAME as on of the field.
    I want to pass value to field NAME.
    Regards,
    Neelambari

    Hi,
    Create a work area as line type. and loop at table type into work area.
    *wa like line type
    *loop at table_type into wa.
    *wa-name = Value.
    *append wa to target table type.
    ****target table type structure should be  same as that of source table type. *****
    Sachin

Maybe you are looking for

  • HTTP error: 500 (Internal Server Error) while creating content server repst

    Hi All, I am getting the HTTP error as mentioned below, HTTP error: 500 (Internal Server Error)"CreateTab ContentStorage, connect error SQLConnect failed, [Microsoft][ODBC Driver Manager] Data s My content server is running on a Microsoft Cluster Env

  • Problem on appending the text file using FileConnection!!!

    it's in here... http://forum.java.sun.com/thread.jspa?threadID=718613&tstart=0 my apology for double-cross posting.. thanks much

  • Error: 'else' without 'if'

    Heres my code, and I am getting this error even tho i have {} pairs correctly placed. This is for a DOS clone that I am implementing in a game.           String command = ""; /*This holds what the user inputs for command line*/           String help

  • D11.5 and AS 3

    I have racked my brain over a seemingly simple question that turned out to be far more difficult for me than expected. I want to pass three variables from a Flash CS4 movie to Director 11.5 lingo. Not being a Flash expert, I got stuck with an incompa

  • At least there's a book on this now

    A guy named Alexis Van Hurkman has written an ebook (it could later be published as a real book if enough of us request it of PeachPit Press): Adobe SpeedGrade: Getting Started, 1/e [Kindle Edition] You have to read it on a Kindle or download the fre