Removing result row value for a single KF rather than all KFs in a query.

Hi,
Is it possible to remove the value in the result row of a query for a particular keyfigure? I want the the values in the result row for all the keyfigures except one. This particular keyfigure should have nothing in the result row. Is it possible in BEx Query Designer? Because my current setup doesnt allow me to use any other BEx tool other than query designer. Would appreciate if someone can provide me a solution for this using query designer. Helpful replies will be rewarded full points.
Regards,
Anurag.

u can do that...
enter into query designer
open ur query
go to columns / rows
select ur keyfigure
on right panel u will see properties for that particular keyfigure
go to the Result row option
Select CALCULATE RESULT AS
then select SUPRESS/HIDE OPTION..
that way u can suppress the result rows for ur keyfigure.

Similar Messages

  • Result Row value Issue

    Hi All,
    I have created a query which has multiple selection & formula in it. One of my formula is not working properly.
    Description of the issue:
    Key figure is "no. of Shipment"
    A calculated key figure "Total no of Shipment" is capturing the result row value of "No of Shipment".
    But some time it doesn't work as expected. I don't know why.
    For example if I select a week range then it dosen't work. I have used the "Total no of Shipment" in no. of other calculated key figure for calculation.
    Meaning for %On-Time = (On-Time A%Total no of Shipment)
    Below query is filter by fiscal week =Result
    Plant|FiscalWeek|NoofShipments|Totalnoof Shipments|%OnTm 
    =====       ======   =========  ==========    ========
    A  |        Result  |     98    |    78    |       104.10 %     
    Here  "Total no. of Shipment" should be 98 but is not able  to pick up the Result value  & it getting 78...I don't know from where it get the number.                                                    
    Please let me know if any body has faced similar case or is there any OSS note to fix the issue.
    Thanks
    Mahendra

    Hi Rishi,
    I tried as per you're suggestion. It didn't work.
    See my key figure is "No.Of Shipment"  & formula is
    "Total no. of Shipment" = SUMCT (No.Of Shipment)
    So whenever the result row of "No.Of Shipment" changes then "Total no. of Shipment" should pick up the value.
    Please let me know if you have any other solution.
    Thanks
    Mahendra

  • How to access each row value for a database item

    On my form I have a database datablock that represents a table in my database.
    5 rows are shown with a scroll bar that can be viewed to show the rest.
    The user is able to change some of the Database Item values represented in this datablock for any row shown in the datablock.
    I need to validate the correctness of the users change before allowing the database datablock to update the table in the database.
    But a database item in a datablock will represent a value for every row in the table. So how do I access each row value for a database item separately. What is the PL/SQL syntax?
    thanks,
    michelle

    In my situation it was better to use the loop instead
    of a when validate trigger because...Well it was clearly not better to use a loop that doesn't work. I don't understand what you're not clear on about the item and record validation triggers. If you have a specific validation rule for a single field (such as a date that cannot be in the future), that would go in a When-Validate-Item trigger on the date item. If the user enters a future date, your code would display an error message and raise a failure. Raising a failure prevents the item from being marked as valid. Invalid items prevent the record from being inserted/updated. Sometimes you have a validation rule that requires looking at more than one item at a time, such as two items that must either both be NULL or NOT NULL. In that case, you could not use a When-Validate-Item trigger because you can't clear or populate both at once. So then you would use a When-Validate-Record at the block level and if one field is NULL and the other isn't, you would display an error message and raise a failure. Forms is very civil in this respect; we don't throw exceptions around here, but then I digress.

  • Entering mulitple values for a single user parameter

    Hello,
    Can anyone explain to me how to allow multiple values for a single parameter?
    For example, say I want to allow the report to display a list of employees based on their employee id. I want to allow the user to enter mulitple
    employee id's into a single field to get their report. SO the user would enter "241, 459, 832" to return the list of those 3 employees. I have the SQL set up below, but obviously I need to set up something different to break it out into 3 separate values. Any help would be greatly appreciated!
    SELECT * FROM EMPLOYEE
    WHERE EMPLOYEE_ID IN (:P_EMP_ID)

    Hi,
    Another way to do this is to use the lexical parameter, but then you have to create the parameter form in Forms. Your SQL would look like this for example:
    select * from emp where empno is not null &empno
    where &empno is a lexical parameter.
    Then on your parameter form you would have a text field F_empid, say 200 character long, allowing the user to enter multiple values separated by a ",".
    Then in the trigger that calls the report you would create a parameter list, and a variable that holds the values read from the form, this variable is where you define the value to be passed to the report's lexical parameter. For example:
    declare
    v_empid varchar2(200); (consistent with the length of the lexical parameter in the report).
    begin
    v_empid:='and empno in ('||F_empid||')';
    then you pass v_empid to &empno in the call to the report.
    This method works well. Good luck.

  • Passing multiple values for a single field in URL to call sap Transaction

    Hi All,
    I need to pass multiple values for a single field to SAP transaction .
    means if i have say a field "Date" which can contain more than one value, <b>but its not a range which has two fields</b> . How is it possible.
    Let me know pls.
    Regards,
    Sirisha.R.S.

    Hi Satyajit,
    I need to call a transaction with multiple values which gives me the report based on those values.
    So I need to pass multiple values for a single parameter.
    I hope u got it.
    Regards,
    Sirisha.R.S.

  • Any way to pass Multiple Values for a single Label in the Parameter?

    I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"
    One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter. 
    PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.
    Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.
    QUESTION:
    Any way to pass Multiple Values for a single Label in the Parameter?
    I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting
    it correct.
    I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….
    Note: We are using Report Builder 3.0

    Based on my experience, there's no way to 'intercept' the query that gets passed back to SQL Server, so a Split wouldn't work.
    Try creating either a function or stored procedure using the code below (compliments to
    http://www.dotnetspider.com/resources/4680-Parse-comma-separated-string-SQL.aspx) to parse the string: 
    CREATE FUNCTION dbo.Parse(@Array VARCHAR(1000), @Separator VARCHAR(10))
    RETURNS @ResultTable TABLE (ParseValue VARCHAR(100))AS
    BEGIN
    DECLARE @SeparatorPosition INT
    DECLARE @ArrayValue VARCHAR(1000)
    SET @Array = @Array + @Separator
    WHILE PATINDEX('%' + @Separator + '%' , @Array) <> 0
    BEGIN
    SELECT @SeparatorPosition = PATINDEX('%' + @Separator + '%', @Array)
    SELECT @ArrayValue = LEFT(@Array, @SeparatorPosition - 1)
    INSERT @ResultTable VALUES (CAST(@ArrayValue AS VARCHAR))
    SELECT @Array = STUFF(@Array, 1, @SeparatorPosition, '')
    END
    RETURN
    END
    Once created you can do things like this:
    SELECT * FROM Parse('John,Bill,David,Thomas', ',')
    SELECT * FROM (SELECT 'John' AS TestName union select 'David' AS TestName) AS Main
    WHERE TestName IN (SELECT ParseValue FROM dbo.Parse('John,Bill,David,Thomas', ','))
    This is what your SQL query would probably look like:
    SELECT OperationID, OperationName FROM dbo.Operations
    WHERE AreaID IN (SELECT ParseValue FROM dbo.Parse(@Area, ','))
    You may need to fiddle around with the Separator depending on whether SQL Server inserts a space between the comma and next value.

  • Hide row values for certain column in GRR2

    Hi Experts,
    Looking for some help in report painter. I need to hide row values for certain columns in report painter. The requirement is I have 5 columns in the report, the 5 th column is the sum of col 1 to 4 and in my row i have a formula setup to sum of values for each column, what i would like to do is for column 1 thru 4 i didnt want to display the total values in row total but i wanted to dispaly value for column 5 in row total. I have been trying my best with putting formula, but couldnt succeed.
    Could somebody let me know is there an way to get this addressed.
    Thanks in advance
    Best Regards,
    gj

    How was it achieved ? Did you use sections for the columns for which rows needed to be hidden?
    I have a smiliar issue of hiding certain rows for few columns.

  • Is it possible to use Aperture to make a new image from two existing ones--ie, in a new jpg? I essentially want to create a collage that I can then print as a single image, rather than in a book. Any advice will be most welcome!

    Is it possible to use Aperture to make a new jpg from two existing ones? I'd essentially like to create a photo collage (without using existing templates) that I can then print as a single image, rather than in a book. Any advice will be most welcome! Thanks.

    https://discussions.apple.com/message/15678716#15678716
    (Added)
    The main point is that Aperture is used to make digital negatives as good as they can be (for the uses you define), but it does not ADD date to your digital negatives, nor does it produce NEW combination files.  For those tasks you need a Graphics program.
    Message was edited by: Kirby Krieger

  • Thinking that I was deleting from my iPod, I have inadvertently deleted a lot of music from my iTunes library.  I clicked for retaining on file rather than sending to trash.  How do I get this music back from file into my library?

    Thinking that I was deleting it from my iPod, I have inadvertently deleted a lot of music from my iTunes library.  I clicked for saving to file rather than sending to trash.  How can I get it back into my library?

    See Empty/corrupt iTunes library after upgrade/crash or simply import the media folder back into the library. Restoring a recent backup of the .itl database will restore the original date added values, ratings, play counts, playlist membership, etc. that would otherwise be missing from the reimported media.
    tt2

  • I want to create a mail merge for address labels into a table, but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address.

    ...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
    Thanks!

    That is a quirk of Pagesthat  it applies only one record per page.
    There is a way around this:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
    Peter

  • PL/SQL muliple row insert for a single row

    I need to insert multiple rows based on a single row record. Below are the table structures and sample data
    CREATE TABLE TEST_SAMPLE (NAME VARCHAR2(20), ATTR_1 VARCHAR2(20), ATTR_2 VARCHAR2(20), ATTR_3 VARCHAR2(20),ATTR_4 VARCHAR2(20));
    CREATE TABLE TRANSACTION (NAME VARCHAR2(20), ATTR VARCHAR2(20))
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('hello','asd','fgh','ert',null);For the above record in table TEST_SAMPLE, three records have to be populated\inserted into table TRANSACTION. In PL/SQL
    stored procedure i am inserting records to TRANSACTION when ATTR_1 or ATTR_2 or ATTR_3 or ATTR_4 is not null.
    Please help me to find a better way for the above insert to table TRANSACTION?

    Thanks for helping me here. For the sample record in table TEST_SAMPLE i mentioned above three records need to be inserted in table TRANSACTION. you have this, or?
    CREATE TABLE TEST_SAMPLE (NAME VARCHAR2(20), ATTR_1 VARCHAR2(20), ATTR_2 VARCHAR2(20), ATTR_3 VARCHAR2(20),ATTR_4 VARCHAR2(20));
    CREATE TABLE TEST_TRANSACTION (NAME VARCHAR2(20), ATTR VARCHAR2(20));
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 1','asd','fgh','ert',null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 2',null,'fgh','ert',null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 3','asd',null,'ert',null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 4','asd','fgh',null,null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 5','asd',null,null,null);
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('record 6',null,null,null,null);
    commit;
    insert into TEST_TRANSACTION
    select NAME,
            ATTR_1
    from TEST_SAMPLE
    where ATTR_1 is not null
    union all
    select NAME,
            ATTR_2
    from TEST_SAMPLE
    where ATTR_2 is not null
    union all
    select NAME,
            ATTR_3
    from TEST_SAMPLE
    where ATTR_3 is not null
    union all
    select NAME,
            ATTR_4
    from TEST_SAMPLE
    where ATTR_4 is not null
    commit;
    select *
    from TEST_TRANSACTION
    order by 1;
    Table created.
    Table created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    Commit complete.
    10 rows created.
    Commit complete.
    NAME                 ATTR               
    record 1             asd                
    record 1             fgh                
    record 1             ert                
    record 2             fgh                
    record 2             ert                
    record 3             ert                
    record 3             asd                
    record 4             fgh                
    record 4             asd                
    record 5             asd                
    10 rows selected.

  • How to pass multiple MDX values for a single parameter into a drill-through report?

    I'm thinking this will be an easy question for any experienced SSRS/MDX developers, at least I hope so!  I've created a report that gives the user the option to choose viewing data for the current/active week, or YTD.  Depending on which link the
    user selects, the report simply calls itself and needs to pass in the parameter value for Active week.  If it's active week, the parameter value will simply be "true".  If it's YTD, the parameter value needs to be both "True" and "False" so the current
    week's data is accounted for as well.  I've set everything up except for the final step, and I have no idea what to type into the Value field below.  I've tried different things: false, as you see below (it errors saying I'm missing the parameter
    value), the value in MDX format: =[School Dates].[Active Week].&[True] (it said I was missing a bracket), a 1 instead of the word true (again, missing a parameter value).  Nothing is working.
    So my question is kindof two-fold: 1) how do you pass in the value at all and 2) more specifically, how do you pass in multiple values (both true & false) ??

    I'm sorry for being so dense, but I'm not quite following, although what I've tried makes me think if I can follow you, it will work :)
    To answer your initial questions, you are correct with both your assumptions:
    1) detailType is the parameter that specificies YTD/Weekly, this is a "report defined" parameter that I am using to determine which Row Group to display (either YTD or Weekly)
    2) SchoolDaysActiveWeek is the parameter that is being set to either true or false -- this is a field in the cube that states whether that record is for the current week or not
    So in following your instructions, well that's the problem I'm not quite following :)
    1) When you say Delete the SchoolDaysActiveWeek parameter from the report only, do you mean to mark the parameter as Hidden?  If so, I've done this.
    2) I'm not quite sure where to use the statement you provided me.  You said to put it in the dataset, but I don't know which dataset.  I assume you mean the "main" dataset (as opposed to the hidden dataset that gets generated when you mark a field
    as a parameter).  If this is the case, the only place I could see that would allow you to use such a statement is in the Filter section of the properties.  I tried this, and it did not generate any errors, but it also kept my report groups from displaying
    -- it just showed a blank report, so I think it probably wasn't bringing back any rows to populate them with.
    I also tried going into the Expression section for the SchoolDaysActiveWeek parameter in the second screenshot and placing the statement there.  When I did this and ran the report, I would get the following error:
    The 'SchoolDaysActiveWeek' parameter is missing a value
    So what am I missing!? 
    Also, thanks for taking the time to respond!!

  • How to place multiple characteristic values for a single Report line

    hi friends,
          I want to display a report with multiple characteristc values in different columns for each instance, For example there are 2 instances and they have multiple characteristics , so all characteristics of each instance  should be displayed in multiple columns in one by one in the same row.
    Thanks in advance.
    RK
    Message was edited by:
            RK

    Hi RK,
        Try this it may help you for multiple values for one instance....
    *Type-pools
    TYPE-POOLS: slis.
    Data declarations.
    DATA: BEGIN OF t_vbak OCCURS 0,
    vbeln TYPE vbeln,
    bstnk TYPE vbak-bstnk,
    erdat TYPE vbak-erdat,
    kunnr TYPE vbak-kunnr,
    END OF t_vbak.
    DATA: BEGIN OF t_vbap OCCURS 0,
    vbeln TYPE vbeln,
    matnr TYPE vbap-matnr,
    netpr TYPE vbap-netpr,
    waerk TYPE vbap-waerk,
    kwmeng TYPE vbap-kwmeng,
    meins TYPE vbap-meins,
    END OF t_vbap.
    DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
    DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
    DATA: v_repid TYPE syrepid.
    DATA: s_layout TYPE slis_layout_alv.
    DATA: v_tabname TYPE slis_tabname.
    DATA: t_events TYPE slis_t_event.
    start-of-selection event.
    START-OF-SELECTION.
    v_repid = sy-repid.
    Get the fieldcatalog for the first block
    PERFORM get_fieldcat1 CHANGING t_fieldcatalog1.
    Get the fieldcatalog for the second block
    PERFORM get_fieldcat2 CHANGING t_fieldcatalog2.
    Get the data for the first block
    SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
    INTO TABLE t_vbak
    FROM vbak WHERE vbeln > '0060000100'.
    Get the data for the second block
    SELECT vbeln matnr netpr waerk kwmeng meins UP TO 10
    ROWS
    INTO TABLE t_vbap
    FROM vbap WHERE vbeln > '0060000100'.
    init
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
    EXPORTING
    i_callback_program = v_repid.
    First block
    v_tabname = 'ITAB1'.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    is_layout = s_layout
    it_fieldcat = t_fieldcatalog1
    i_tabname = v_tabname
    it_events = t_events
    TABLES
    t_outtab = t_vbak.
    Second block
    v_tabname = 'ITAB2'.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    is_layout = s_layout
    it_fieldcat = t_fieldcatalog2
    i_tabname = v_tabname
    it_events = t_events
    TABLES
    t_outtab = t_vbap.
    *Display
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    FORM GET_FIELDCAT1
    Get the field catalog for the first block
    FORM get_fieldcat1 CHANGING lt_fieldcatalog TYPE
    slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    Order number
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'VBELN'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Customer purchase order.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'BSTNK'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'BSTNK'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Creation date.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'ERDAT'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'ERDAT'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Customer
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'KUNNR'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'KUNNR'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    ENDFORM.
    FORM GET_FIELDCAT2
    Get the field catalog for the second block
    FORM get_fieldcat2 CHANGING lt_fieldcatalog TYPE
    slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    Order number
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'VBELN'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Material number
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'MATNR'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Net price
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'NETPR'.
    s_fieldcatalog-cfieldname = 'WAERK'.
    s_fieldcatalog-ctabname = 'T_VBAP'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Currency.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'WAERK'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'WAERK'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Quantity
    s_fieldcatalog-col_pos = '5'.
    s_fieldcatalog-fieldname = 'KWMENG'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'KWMENG'.
    s_fieldcatalog-qfieldname = 'MEINS'.
    s_fieldcatalog-qtabname = 'T_VBAP'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    UOM
    s_fieldcatalog-col_pos = '6'.
    s_fieldcatalog-fieldname = 'MEINS'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'MEINS'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    ENDFORM.
    Plz Reward points if contents are useful,,,
    Regards,
    Mandeep.

  • Compare previous row values for the same id and decide

    Hello ,
    I have this sample data
    create table #student_academic
    pk_id int identity(1,1) primary key ,
    student_id int ,
    [year] int,
    [aggr_marks] float
    insert into #student_academic
    student_id ,
    [year] ,
    [aggr_marks]
    values
    (112,2012,55.4),(113,2012,65.4),(114,2012,82.32),
    (112,2013,75.4),(113,2013,91.22),(114,2013,45.45),
    (112,2014,61.2),(113,2014,95.2),(114,2014,75.6)
    select * from #student_academic
    from the above data i have to generate an extra status column. this status column should be decided by comparing the previous row value. the exact output should be like below.
    student_id year aggr_marks Staus----------------------------------------------------------
    112 2012 55.4 None
    112 2013 75.4 Promoted
    112 2014 61.2 Demoted
    113 2012 95.2 None
    113 2013 75.6 Demoted
    113 2014 91.22 Promoted
    113 2012 45.45 None
    113 2013 65.4 Promoted
    113 2014 82.32 Promoted
    is there any way to write the t-sql with out using cursors ? this table has around 25GB of data. Any idea would be appreciated.
    Thanks in advance.

    Hello,
    The difficulty of your example is
    that there are several rows for
    the same year and the same student.
    I present a solution
    if there is
    one line per year per
    student:
    TRUNCATE TABLE #student_academicinsert into #student_academic
    student_id ,
    [year] ,
    [aggr_marks]
    values
    (112,2012,55.4),(113,2012,65.4),(114,2012,82.32),
    (112,2013,75.4),(113,2013,91.22),(114,2013,45.45),
    (112,2014,61.2),(113,2014,95.2),(114,2014,75.6)
    Go
    WITH CTE AS
    (SELECT pk_id, student_id, year, aggr_marks,
    (SELECT TOP 1 aggr_marks FROM #student_academic AS b
    WHERE a.student_id = b.student_id AND a.year -1 = b.year
    ORDER BY student_id) AS prev_aggr_marks
    FROM #student_academic AS a
    SELECT
    pk_id, student_id, year, aggr_marks,
    CASE
    WHEN prev_aggr_marks IS NULL THEN 'None'
    WHEN aggr_marks < prev_aggr_marks THEN 'Demoted'
    WHEN aggr_marks >= prev_aggr_marks THEN 'Promoted'
    END AS Status
    FROM CTE
    ORDER BY student_id, year
    Regards,
    Charlie
    Charlie Dancoisne - Independent Consultant & Trainer (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable. This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Result Analysis Values For particular period/year!!

    Hi Experts
    We are in a customer project, tenure of a project is around 2 to 3 years. As company follows Accounting standard AS-7 where we need to recognize the revenues in the same period in which the cost incurred. So, to achieve that we have planned the cost and revenue periodically for the years 2011-2012 ,2012-2013. But when i am running RA (KKA2) the results shows planned revenue and cost  as sum of all the years ,so accordingly POC will be based on overall Plan Cost and not Annual(Period ) based.
    But our requirement is that when i run RA for given period of particular year then RA should show planned cost and revenue for that particular period/year and accordingly  rest of the values like; POC, WIP, Reserves etc.. should get calculated .
    Please suggest how to approach to achieve the same.
    Thanks in advance..

    I think it is possible to meet your requirement through valuation method settings.
    please read sap help on RA.
    Please follow the below path to access the RA help
    SAP help portal -- Financials >> Controlling >> Product Cost Controlling >> Cost Object Controlling >> Product Cost by Sales Order >> Period-End Closing in Product Cost by Sales Order: Scenario >> Result Analysis

Maybe you are looking for

  • Error formula SUMCT with drill across.

    Hello everyone, I have a problem with the formula SUMCT. A formula has been defined applying the SUMCT operator to the 0???? index 0DEB_CRE_LC. The 0COSTELMNT characteristic is on the query rows, and a hierarchy is active on the cost element. When th

  • Software Change Management - usage in SAP

    Hi, Please anybody can - Are we using version control tools like ration rose, SCM – Software configuration Management in SAP? Thanks in advance Swamy

  • SAP Authorization in XI for SLD is red in PFCG

    Hi To perform the post-installation activities in XI 3.0 on Windows and Oracle DB, I created the XISUPER user in SAP Exchange Infrastructure client: As a Dialog User created role for XISUPER are follow.. SAP_BC_AI_LANDSCAPE_DB_RFC SAP_SLD_ADMINISTRAT

  • OBIEE 10.1.3.2 version : 404 error when presentation services started

    Hi , Installed OBIEE 10.1.3.2 in windows 7 in compatilibily mode And the BI server and presentation services started. then started the ocj4 instance and then started the presentation services but it resulted in a 404 error webpage instead of answers.

  • MAC PSE 8 upgrade to 10 issue

    I've searched and not found the answer I'm searching for. I called Adobe Sales who said to upgrade to 10 to stop me from having to redo all my near 20K images again in LR. What I want to do: I have been using BR on my MAC for some time now. My Sony S