How to calculate Lower Quartile and Upper Quartile

I have a table with following data.
Property_number         calc_class
1000                          150
1000                           100
1001                              300
1002                              400
1002                              450
1003                              700
1004                              800
I need to calculate lower and upper quartile for a given property number.Can anyone please help me in this?
Thanks in advance!!

I have a table with following data.
Property_number         calc_class
1000                          150
1000                           100
1001                              300
1002                              400
1002                              450
1003                              700
1004                              800
I need to calculate lower and upper quartile for a given property number.Can anyone please help me in this?
Thanks in advance!!
Something like this
WITH QCalc
AS
select
Property_number,
Calc_class,
ROW_NUMBER() OVER (PARTITION BY Property_number ORDER BY Calc_class) AS 'RN'
from #quartiletest
SELECT
Property_number,
Calc_class,
ROW_NUMBER() OVER(PARTITION BY Property_number ORDER BY RN asc) AS RowAsc,
ROW_NUMBER() OVER(PARTITION BY Property_number ORDER BY RN desc) AS RowDesc
FROM QCalc
Source: Calculating lower and upper
quartiles for box plot lower and upper quartiles for box plot 
web: www.ronnierahman.com

Similar Messages

  • How to calculate AP invoice and AP downpayment AR Credit Memo together?

    Dear All,
    Does anyone know how to calculate AP invoice and AP downpayment AR Credit Memo together for the purchase summary, by using SQL statement?
    Is it sum altogether...like AP_Invoice + AP downpayment - AP Credit Memo?
    The result as shown below:
    BP_Code        Total
    XXXXXXXX        $10,000
    From Samson
    Edited by: samson leung on Jun 10, 2009 9:49 AM

    Try this to start:
    Select T0.CardCode 'Vendor#', Sum(t0.DocTotal - isnull(t3.DocTotal,0)) 'Total'
    from dbo.opch t0
    inner join dbo.pch1 t1 on t1.docentry = t0.docentry
    left join dbo.rpc1 t2 on t2.docentry = t1.TrgetEntry
    left join dbo.orpc t3 on t3.docentry = t2.docentry
    group by T0.CardCode
    Thanks,
    Gordon

  • Urgent : how to calculate sub total and grand total in smart forms

    Hi Friens..how to calculate sub total and grand total in smart forms..How to print them in smart forms...Also kindly explain how to handle events in smart forms..Thanks in advance

    Re: Subtotal with Table Node in smartforms

  • How to calculate New customers and Returning customers in a Pivot Table?

    Hi,
    I have a Pivot table with columns as Order Date, Customer Name, Qty, Cost, Freight, Invoice, Adv Payment. I have only 30 customers and 11000 transactions for 4 years sales period.
    How to calculate New customers and Returning customers in Pivot Table for any given Month or Quarter or Year. I am open to use helper column, formula or a calculated field etc
    Thanks
    Arjun

    Hi Arjun,
    I have received the file and read it, based on your further explain, I know your requested more clarity. In my view, the requested could be done via VBA code or Select function in other dataset, like Access/SQL. (Because before we count the new
    customer and return customer, we might to filter them via rule, the formula need to assign the customer one by one. So, it's inefficient)
    Thus, I recommend we try the above workaround: Use macro or Select function in Access. If you have further question about the coding, please post to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How to convert lower case to upper case?

    Hi,
    How to convert lower case letter to upper case and vice versa?

    TRANSLATE
    Variants:
    1. TRANSLATE c TO UPPER CASE.
    2. TRANSLATE c TO LOWER CASE.
    3. TRANSLATE c USING r.
    See String processing
    Variant 1
    TRANSLATE c TO UPPER CASE.
    Variant 2
    TRANSLATE c TO LOWER CASE.
    Effect
    The first variant converts all lowercase letters in c to uppercase. The second variant converts all uppercase letters to lowercase.
    Example
    DATA letters(3) TYPE C.
    MOVE 'abc' TO letters.
    TRANSLATE letters TO UPPER CASE.
    letters now has the contents 'ABC'.
    Note
    The classification of upper- and lowercase, and the actual characters used are determined by the current text environment (see SET LOCALE LANGUAGE). Problems may occur when the system converts the characters, if the wrong language has been specified in SET LOCALE LANGUAGE, or if data has been processed that does
    Variant 3
    TRANSLATE c USING r.
    Effect
    Replaces all the characters in the field c according to the rule in field r. c1 containscharacter pairs. The second character in each pair replaces the first. If r does not contain a character in c, this character remains unchanged. r can also be a variable.
    Example
    DATA: letters(20) TYPE C VALUE 'abcabcabcXab',
          change(15)  TYPE C VALUE 'aXbaYBabZacZ'.
    TRANSLATE letters USING change.
    letters now contains 'XaZXaZXaZXXaZ'.
    REWARD IF USEFUL

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • How to calculate Deadline Date and Time

    A support desk message has been created and support team has to respond in fixed time duration.
    Creation time of message and duration of response are available.
    How to calculate the exact time and date where this deadline expires using the factory calendar.

    java.util.Date date = java.util.Calendar.getInstance().getTime(); //retrieve a date object
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat(dd-MMM-yyyy);
    String s = df.format(date); //10-Aug-2001
    String t = "15042001";
    df.applyPattern("ddMMyyyy");
    d = df.parse(t);
    df.applyPattern("dd-MMM-yyyy");
    t = df.format(d); //15-Apr-2001Hey it's Friday, I'm bored

  • HOW TO CALCULATE NET SALES AND CONTRACT PRICE?

    Dear experts,
    I have the requirement of sales price report
    the report layout should be
    Prod descr    material Number   Contract type  contrcat name     rebate  net sales  contract price  units
    we have the master data information is reside already in multiprovider and transaction information how to calculate in frond end ?
    for sales  pricing report how to manipulate teh net sales and contract  price
    value?
    any standard formulaes is there?
    plz suggest  me
    regards

    Hi,
    For quick and best response unless someone answer's in this forum, post your question in SAP Community Network Forums » SAP Solutions » ERP - Sales and Distribution (SD) General   or something related to your question.
    Check this link if it helps -
    http://help.sap.com/saphelp_46c/helpdata/en/93/74353e546011d1a7020000e829fd11/frameset.htm
    Thanks,
    Shambhu.

  • How to calculate circle number and distinguish the two kinds of circle

    Hello everyone,
    Now, there is a problem to find the calculate circle number and distinguish the two kinds of circle in the following picture. You will find that there is two kinds of hole in the following picture, one is blind hole(3 holes), the another is through hole(19 holes).
    That is to say, the first task is to calculate circle number, the second task is to distinguish the two kinds of circle in the following picture.
    Can you give me some advice how to deal with this problem in the NI Vision Development Module or  NI Vision Assistant. 
    Thank you.
    Kindly Regards
    kevin.wang
    Attachments:
    instruction.png ‏106 KB
    Original.png ‏35 KB

    Yes, you are right. The  through holes is overlay by the  the green square point, and tge blind holes is marked by red circle. Please find the original picture and analyzed picture in the attached files.
    Attachments:
    original f.png ‏346 KB
    Analyzed f.png ‏482 KB

  • How to calculate start date and last date for current week

    Dear All.
    i want to calculate the start of the current week as well as the last date of the current week, our week start from Saturday and ends of Friday i.e. Saturday is the first day of the week and Friday is the last day of the week.
    How can i acheive this in universe Designer?.
    Please help...

    Hi
    the formulas in webi will be as follows
    for startdate
    =RelativeDate(LastDayOfWeek(CurrentDate());-8)
    for enddate:
    =RelativeDate(LastDayOfWeek(CurrentDate());-2)
    Regards,
    Ranganath

  • How to calculate the size and number of nodes in the btree?

    I need to determine the size of the btree nodes in the log file and the how many internal and leaf nodes in the btree. For example if I have 2.88M records approximately how much disk space is used up by the JE's internal structures? This info will help me determine the best size of the data records.

    Chad,
    Keys are stored in order in the btree. They are ordered by the custom comparator if one is used, otherwise by the default (unsigned byte) comparator.
    Key prefixing (when it is available -- remember that we're talking about a future feature here) reduces memory and disk space for the adjacent keys in a Btree node when the initial bytes of those keys are in common.
    If your keys that are adjacent (according to your custom comparator) don't have common bytes at the front, then key prefixing won't have any advantage.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • HT4480 I have an App Store gift card that has been verified as active by tech support however, when I tap " redeem " I get no response at all on my screen. I have tried to enter it in lower case and upper case with no luck. Any suggestions???

    My " App Store" card will not load on my I pad. Am I doing something wrong??

    I have not seen this issue before, but why are you using 4.3.3 may I ask?

  • How to calculate YTD credit amount and YTD Debit amount

    How to calculate credit amount and Debit amount for Year-To-Date type in GL Trial Balance Report?

    You may try the following options.
    1. Run 'Expanded Trial Balance' report.
    2. Run 'Trial Balance' report.
    3. Create FSG report for trial balance based on your desired output format.
    Hope it is useful.
    Tarun

  • SharePoint crawled property with both lower and upper case

    I have web page which has meta tag, like CN_ABC, then after I crawled these pages, and when I try to map this property to a managed property, I always see there are two crawled property available, one is CN_ABC, the other is CN_abc, only difference is
    the lower case and upper case, I have seen this in many other site and many other meta tag, what was happening?

    The meta tag you mean is a site column created for the page library?
    This doesn't seem can be happened, if it is a site column, then it will create a crawled property for the column, named like: ows_sitecolumn, also, CN_ABC, CN_abc is not to distinguish lower or upper case, it should be CN_ABC or cn_abc.
    I would suggest you to delete the related crawled property for the column, then do a full crawl, check whether it is happened, if it insistes, map the crawled property to different managed property, whether it returns same value.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • How to calculate Reactive component & bill energy loss

    Hi,
    How to calculate energy losses and bill customers.We have kw and kWh registers.
    How to calculate reactive component.
    Pls help..
    Thanks

    As far as I know, we need to maintain a reactive register at the register group level. Reactive/ Active register relationship will give you the Power Factor, which is a measure of effective utilization of electrical power.
    Just my 2 cents!
    Regards,
    Rajini.

Maybe you are looking for

  • IPhone 2g won't boot up AT ALL ?!

    I was going to charge my iphone on the dock, when i put it in the dock, suddenly, the screen goes all black. I hit the sleep button to boot it, but it won't boot. I tried the home button and the sleep button wont work. So went to apple.com for suppor

  • LG Spectrum Problem

    Have had a pretty good time with LG Spectrum till now. Phone randomly turns off then back on. Phone is also overheating . Except for newest software upgrade (which has not shown up on my phone yet) phone is updated. Have bought a new battery and usin

  • The editing feature of photoshop elements stopped working what is the solution

    the  editing feature of photoshop elements stopped working after i installed nik efex pro wacom pen.

  • Another windows filesharing issue...

    im sure you guys have heard a ton of these, ive already searched and i cant find my exact problem though. connecting to my computers is no problem with the finder cmd+k shortcut to connect to server etc... but heres what i really liked; when i first

  • Catalyst control system stop working

    recently i upgrade my laptop from windows 8 to 8.1 my laptop is hp pavilion e015tx after updating operating system when i try to open "configure switchable graphics" or " graphics properties" it will not open and give message "catalyst control contro