Skip to Content
author's profile photo Former Member
Former Member

To calculate the median .

Dear friends,I am having a problem in calculating the median for the field annual salary.I want to get the median for every grade type that i enter.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 08:47 AM

    Hi,

    try this function module :-

    SLS_MISC_GET_MEDIAN

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 09:20 AM

    Hi Amitesh,

    Run the code below. It should be self explanatory...

    SORT itab BY field1 field2.
    LOOP AT itab.
    
      count = count + 1.
    
      AT END OF field2.
        meantab-field1 = itab-field1.
        meantab-field2 = itab-field2.
        meantab-freq   = count.
        APPEND meantab.
        CLEAR: meantab, count.
      ENDAT.
    
    ENDLOOP.
    
    SORT meantab BY field1 field2 freq DESCENDING.
    LOOP AT meantab.
      AT END OF field2.
        "Here you get highest freq by field1 field2.
      ENDAT.
    ENDLOOP.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 09:23 AM

    Ignore my answer as its already answered

    Hi,

    Use FM:

    SLS_MISC_GET_MEDIAN

    With luck,

    Pritam.

    Edited by: Pritam Ghosh on Jan 15, 2009 10:26 AM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.