How to do the ranking by writing a measure?

Hi, I'm trying to write a measure to show the ranking of each customer in the powerpivot pivot table. The rank is calculated based on rolling 12 months sales. I used RANKX but the result was inaccurate as shown below.
AK_End_Customer_Name__rName
Rolling12mSales
Rank
XX机场
$3,809,824
1
XXX公司上海分公司
$2,434,245
1
上海XXX大厦
$1,103,973
2
上海XX管理有限公司
$862,068
3
上海XXX公司
$774,446
4
XXX南京分公司
$773,532
1
XXXX服务有限
$607,462
5
XXX广场
$453,013
6
XX广场
$420,585
7
XXX管理中心
$376,319
8
XX管理有限公司
$336,015
9
XXX儿科医院
$326,686
10
上海XX服务有限公司
$273,933
11
XXX中心
$265,592
12
上海XX公司
$220,987
2
My formula is =IF(NOT(ISBLANK([Rolling12mSales])),RANKX(ALL([EndCustomerName]),[Rolling12mSales]),BLANK())
Can someone help with this? Really appreciate it.
Alex

you may simply use built-in Pivot Table ranking as I described here:
https://social.msdn.microsoft.com/Forums/en-US/a0d37f68-bd40-43db-8f30-60964c3df10b/rankx?forum=sqlkjpowerpivotforexcel
hth,
-gerhard
Gerhard Brueckl
blogging @ http://blog.gbrueckl.at
working @ http://www.pmOne.com

Similar Messages

  • How often does the m7 take a steps measurement?

    I have an iPhone 5s. I checked my steps in the health app and if I am to believe what I saw, the m7 takes 5 or 6 measurements per minute (that part I believe) and the hard part is that I took 200 or so steps in 1 minute. How often is the iPhone taking a steps measurement? It's not like I was running. I was in the grocery store, I think.

    Hi Kumar,
    I wasn't sure if it is done dynamically whenever there are changes or if there were timers that it uses to conduct it's table refresh rates and are those timers adjustable?  The documentation on the Cisco site is very vague when it comes to CEF tables on IOS's 15.1 and above.  Any good links you have on how it does it's updating would be very helpful to me - thanks!

  • How to display  the rank

    Hi,
    http://rapidshare.com/files/401755613/Kishore.jpg.html
    please download the file by using link. that is the snapshot of my requirement.
    I wand to display the rank based on the value seleted on the column selector
    The Rank should be applied based on the grand total
    If i select Regions in the column selector i need to apply rank to the grand total of the dollars by region wise
    like wise
    If i select markets in the column selector i need to apply rank to the grand total of the dollars by market wise
    so , dynamically i need to set the formula of rank column
    can anybody help on this
    Thanks & Regards
    Kishore P

    Hi Frederic,
    I think this can be achieved by defining the conditions in BEx analyzer. Define a new condition with Key figure 'Orders' and use a condition Top N and give the value as 10.
    http://help.sap.com/saphelp_nw04s/helpdata/en/c1/5f6039ae48e623e10000000a11402f/frameset.htm
    Hope this helps............
    Rgs,
    I.R.K

  • How to return the rank compared to other cells in Numbers

    Hi All,
    I am working on a spreadsheet that provides a seasonal average for a set of canvassers. I would then like to add a column which returns their ranking compared to the others. For instance:
    Canvasser
    6/1/2012
    6/2/2012
    6/3/2012
    6/4/2012
    6/5/2012
    Average
    Rank
    Joe
    145
    175
    200
    275
    145
    =average(b2:b6)
    Tom
    105
    165
    175
    205
    105
    =average(b3:b6)
    Ellen
    155
    185
    205
    300
    175
    =average(b3:b6)
    So, the rank column should return Joe as 2, Tom as 3, and Ellen as 1.
    Thanks for your help!
    Cheers,
    Koz

    Hi Kozguy,
    Let's start with the Averages column:
    Assuming the names are listed in column A, and that there are no hidden columns, Average is column G (ie. not column '7')
    The formula for Joe's average should be =AVERAGE(B2:F2).
    Filled down, that will also give the correct formulas for Tom's and Ellen's averages.
    Rank is calculated in column H, using the RANK function.
    Canvasser
    Jun 1, 2012
    Jun 2, 2012
    Jun 3, 2012
    Jun 4, 2012
    Jun 5, 2012
    Average
    Rank
    Joe
    145
    175
    200
    275
    145
    188
    2
    Tom
    105
    165
    175
    205
    105
    151
    3
    Ellen
    155
    185
    205
    300
    175
    204
    1
    H2: =RANK(G,G$2:G$4)
    And fill down to H4.
    Regards,
    Barry

  • How to caculate the records count for a measurement with a filter?

    I have a fact table which add relationship to a datetime dimension. I create a measurement based on the fact table, like [MeasureA]. I want to calculate the record counts of [measureA] of today, how to write the mdx query? Thanks!

    Hi Lavandula,
    According to your description, you want to calculate the numbers of the record of a measure for a specific day, right? In this case, you can use
    Count function which returns the number of cells in a set to achieve you requirement. Here is a sample query on Adventure Works for your reference.
    WITH
    MEMBER [Measures].[SetCount] AS
    COUNT([Product].[Product].[Product].Members)
    SELECT
    {[Measures].[SetCount]} ON COLUMNS
    FROM
    [Adventure Works]
    Besides, if you want to count the cell numbers with a condition, you can use
    Filter funtion inside the Count function.
    WITH MEMBER [Measures].[High Volume Products Count] AS
    Count(Filter([Product].[Product].[Product], [Measures].[Internet Order Quantity] > 5))
    SELECT [Customer].[Customer Geography].[Country] ON 0
    , [Date].[Calendar].[Date].MEMBERS ON 1
    FROM [Adventure Works]
    WHERE [Measures].[High Volume Products Count]
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to get the ServletContext when writing a class

    Morning,
    I've got a project using al least 4 jsp documents that try to manipulate a mysql database
    To access the database and get a connection, i've put this syntax at the start of each document
    <%! Connection con; %>
    <%     
    String url =  (String)application.getInitParameter("databaseUrl");
                   String username = application.getInitParameter("username");
                   String password = application.getInitParameter("password");
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
               con = DriverManager.getConnection(url, username, password);
                   %>Those documents also use classes that I create, what I want to do is keep the code I've written above in one place instead of 4 different places, Is there a way I can use the application variable, which belongs to ServletContext in a class (not a servlet)
    Message was edited by:
    Octavian

    This syntax reference JSP 2.0 : http://java.sun.com/products/jsp/syntax/2.0/syntaxref20.html
    covers JSP actions such as jsp:useBean , jsp:getProperty and jsp:setProperty.
    The API for JSTL is pretty intuitive:
    http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html
    But if you need more details on a particular JSTL tag you can refer to the JSTL 1.1 Specification - it's a PDF document.
    JSTL also uses EL (Expression Language) which is also covered by the JSTL specification and by the above JSP 2.0 syntax reference.
    There are many JSTL tutorials and articles too, but most of them are old so they contain JSTL 1.0 code.
    To get yourself started you need jstl.jar and standard.jar which come with the latest JSTL 1.1 distribution found here:
    http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
    Standard-1.1 (JSTL 1.1) requires a JSP container that supports the Java Servlet 2.4 and JavaServer Pages 2.0 specifications. Jakarta Tomcat 5 supports the new specifications. The Standard-1.1 taglib has been tested with Tomcat 5.0.3.
    After you have set up your environment you can test it with a small sample of JSTL code like this:
    inside sample.jsp
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <c:set var="someVariable" value="Hello World!"/>
    <c:out value="${someVariable}/>
    null

  • How to find the Minimum value of a Measure across a Custom Dimension

    I am having Trouble figuring the best approach for the given below scenario.
    I have a measure called Inventory which is basically by Product by Part by Geography across a Time period.
    Part dimension is 3 levels Deep.
    Part
    --Configuration_NAME
    - Part_ID
    the Requirement is to Pick the the Minimum Inventory Values of a product across the Configuration_Name and Store this information in another measure called Inventory_Min.
    here is how the data mock up looks like
    config1 - product1- Inventory - 100 (Period1)
    config2- product1-Inventory-200 (Period1)
    config3-Product1-inventory-400 (Period1)
    now the output expected is
    Config1-Product1-Inventory_MIN - 100(Period1) since for this product across 3 configs, 100 is the minimum inventory.
    I am trying to use @RANGE,@MINS but i am not sure how to tell essbase to go down the Part Dimensions, level 1 members and not across the Period.
    any help or points will be appreciated.
    Thanks,
    Sriram

    Hello,
    what about @MINSRANGE ?
    http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/minsrange.html
    Inventory_MIN = @MINSRANGE(SKIPBOTH, "Inventory" , @LIST("config1","config2","config3"))
    should give the result,
    if you FIX @RELATIVE("Part",-1) to grab level 1 members.
    and you can extend expression something like
    Inventory_MIN = @MINSRANGE(SKIPBOTH, Inventory , @CHILDREN(@CURRMBR("Part")))
    Hope it helps,
    Ahmet

  • SSRS report with tabular model – MDX query how to get the sum and count of measure and dimension respectively.

    Hello everyone,
    I am using the following MDX query on one of my SSRS report.
    SELECT NON EMPTY { [Measures].[Days Outstanding], [Measures].[Amt] } ON COLUMNS,
    NON EMPTY { ([Customer].[Customer].[Customer Key].ALLMEMBERS) }
    HAVING [Measures].[ Days Outstanding] > 60
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM ( SELECT ( STRTOSET(@Location, CONSTRAINED)) ON COLUMNS
    FROM ( SELECT ( {[Date].[Fiscal Period].&[2014-06]}) ON COLUMNS
    FROM [Model]))
    Over here, the data is being filtered always for current month and for a location that is being selected by user from a report selection parameter.
    I would like to get the count of total no. of customers and sum of the amount measure.
    When I am using them in calculated members it gives incorrect values. It considers all records (ignores the sub-select statements) instead of only the records of current month and selected location.
    I also tried with EXISTING keyword in calculated members but there is not difference in output. Finally, I manage the same at SSRS level.
    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Any help would be much appreciated.
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Hi Ankit,
    We can use SUM function and COUNT function to sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension. Here is a sample query for you reference.
    WITH MEMBER [measures].[SumValue] AS
    SUM([Customer].[Customer].ALLMEMBERS,[Measures].[Internet Sales Amount])
    MEMBER [measures].[CountValue] AS
    COUNT([Customer].[Customer].ALLMEMBERS)
    MEMBER [Measures].[DimensionName] AS [Customer].NAME
    SELECT {[Measures].[DimensionName],[measures].[SumValue],[measures].[CountValue]} ON 0
    FROM [Adventure Works]
    Besides, you ask that does it make any difference if I manage it as SSRS level and not at MDX query level. I don't thinks it will make much difference. The total time to generate a reporting server report (RDL) can be divided into 3 elements:Time to retrieve
    the data (TimeDataRetrieval);Time to process the report (TimeProcessing);Time to render the report (TimeRendering). If you manage it on MDX query level, then the TimeDataRetrieval might a little longer. If you manage it on report level, then the TimeProcessing
    or TimeRendering time might a little longer. You can test it on you report with following query: 
    SELECT Itempath, TimeStart,TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering, ByteCount, [RowCount],Source
    FROM ExecutionLog3
    WHERE itempath like '%reportname'
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to calculate the acceleration of a digitally measured distance

    Hello reader,
    I'll try to explain my problem. I'm using a laser displacement sensor in order to measure the movement of a vibrating table (approx. 20 Hz). The controller of the sensor is connected to my COM port and I read 213 distances per second. (maximum because of baudrate).
    With this signal I want to calculate the acceleration of the table. The problem is that the signal is not 'smooth' enough (about 10 data points per period) to derive it directly.
    I was thinking about applying some kind of curve fitting and use this signal as the input for the double derivation. I have however problems with creating a proper input for the General polynomial fit.vi. Another idea was to use the Extract si
    ngle tone information.vi. This however also fails to work (yet) also.
    So my questions are mainly if someone thinks there is a much better or easier way to solve this or that someone can provide help with building what I described above.
    Many thanks in advance for your answer!
    J-M

    Hello,
    First of all thanks for your fast answer.
    I'll try to provide you some additional information:
    I expect my signal to be almost a pure sine tone, although there might be some (small) noise. Where my main problem is, is that I'm reading data through my serial port after which I convert it to a number. The main difficulty (or at least the first) is to convert these numbers into the required input for these vi's.
    (a waveform for the FFT power spectrum.vi or an array for the power spectrum.vi)
    This includes your second question: I'm afraid I'm using the asynchronous acquisition. Any ideas to avoid this?
    I'm currently using Labview 6i. I attached my current vi (it does not show all the time I'm already trying!)
    Thanks in advance fo
    r your reaction,
    J-M
    Attachments:
    Distance_reading_8.vi ‏98 KB

  • How to change the iPhoto Photo Book Size Measurement?

    Hi guys,
    I am annoyed that when I create my book in iPhoto Book, the measurement is in CM and in Malaysia, all the Book Printer is measured in Inches... I have tried changing the setting but to no avail.
    Kindly help...
    Thanks a lot...

    It is easy - open the book and click on themes and select the new size - it is best to dupicate the book first incase something goes wrong
    And preview carefully before ordering -
    Before ordering your book preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    It is possible that text can change around and be unacceptable
    LN

  • How to optimize this sql by writing MINUS function.

    Hi all,
    how to optimize the sql by writing MINUS function.
    these are my tables
    1. CREATE TABLE POSTPAID
    RECORD VARCHAR2(2000 BYTE),
    FLAG NUMBER
    Record format:
    Mobile no in 1:10 of that length
    2. CREATE TABLE SUBSCRIBER
    PHONE_NO VARCHAR2(10 BYTE)
    My requirement is following sql need write using ‘minus’ as this one is very slow
    select record record from POSTPAID where substr(record,9,10) NOT in (select PHONE_NO from SUBSCRIBER)
    Thanks

    Why are you very particular about using "MINUS". You can optimize the sql by using "NOT EXISTS" instead of "NOT IN" as below:
    SELECT RECORD FROM POSTPAID A WHERE NOT EXISTS (SELECT 1 FROM SUBSCRIBER B WHERE SUBSTR(A.RECORD,9,10) = B.PHONE_NO)

  • I have just used air display with macbook pro. i have disconnected now from apple tv. but my laptop screen is still very small like its connected to the tv. this means all the tabs and writing is very small, how do i full disconnect my laptop?

    i have just used air display with macbook pro. i have disconnected now from apple tv. but my laptop screen is still very small like its connected to the tv. this means all the tabs and writing is very small. like the display down the bottom where al the applications are, is n the middle of the page and not spread down the bottom. this is seriously annoying! all the writing is every small and the tabs are small and its hard to read.  the air display link has disappeared from my computer. but the laptop screen is still very small. i want to know how do i get rid of this and return my macbook screen to its normal size. thank you

    Hello chrispyw,
    If your content is still being displayed incorrectly, I would check the resolution setting for the built in display with this article:
    OS X Yosemite: Adjust your display’s resolution
    If it keeps happening whenever you use AirPlay then I would use this section of the following article to reset the display system:
    Apple computers: Troubleshooting issues with video on internal or external displays
    Reset the system
    You can reset the Mac's parameter RAM and SMC.Reset the resolution
    Start by resetting the Mac's parameter RAM. If the display does not come up, was previously set to an unsupported resolution, and still results in no video:
    Start up in Safe Mode.
    From the Apple () menu, choose System Preferences.
    Choose Displays from the View menu to open the preferences pane.
    Select any resolution and refresh rate that your display supports.
    Restart your computer.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • How to call the DLL writing in Vb6.0 from testsatnd?

    Hi,
    I want to call a dll writting in VB6.0 from teststand. But as i see from the "Step Setting" in teststand, only the C/C++ Dll can be selected in the "adapter" type. I try to use this one as my adapter to call my VB6.0 dll, in result, there is no function can be seen in the "function" tab in teststand.Anyone know how to call the DLL writing in Vb6.0?
    Solved!
    Go to Solution.

    Hi Ivan,
    Just to be sure that your DLL is not wrong
    you have check if all functions are well and present.
    There is  tool called "Dependency Walker"   You can download it at http://dependencywalker.com/ .
    With it you can look "inside" your dll
    If you will see your functions there, you will see them (in my case !!always!!) in TestStand, too.
    Hope this helps 
    Greetings
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • I like the mail feature with one exception; I cannot figure out how to change the font size of incoming mail permanently.  And, when answering an email I have to highlight the first few words and zoom it so I can see what I am writing.  what am I missing?

    I like the mail feature with one exception; I cannot figure out how to change the font size of incoming mail permanently.  And, when answering an email I have to highlight the first few words and zoom it so I can see what I am writing.  what am I missing?

    You can type the email using what you set in preferences and then highlight the text and use command - minus sign (or command - + for larger) to reduce the size of the text.
    You can also type command - T and a window will appear allowing you to select fonts/sizes/color/ background highlight.
    The above works in Notes also. I haven't tried to do this in any other Apple application.
    For incoming emails, you can use the above to reduce font size, but I don't know of a way to permanently set the incoming font size to a default.

  • Three keys of my keyboard are not working, the cap one, the return key and the space bar, while the virtual keyboard shows to others keys highlighted in orange (^ and `); How to fix it? I writing now with a bluetooth keyboard.

    Three keys of my keyboard are not working, the cap one, the return key and the space bar, while the virtual keyboard shows to others keys highlighted in orange (^ and `); How to fix it? I writing now with a bluetooth keyboard.

    All new keyboards need Snow Leopard 10.6.8 and above for full functionality.
    Rather short-sighted of Apple perhaps, but that seems to be a trend these days.
    I'm afraid the only fix is to upgrade to SL. Personaly, I'd take it back and get a refund and seek an older keyboard or a third-party one elsewhere.

Maybe you are looking for

  • Using a Compiled Java Class --- Error

    Hi All, I am new to jsp tech. I am using 'Sun Java system application web server'. I am getting following error when running ch06_02.jsp : type Exception report message description The server encountered an internal error () that prevented it from fu

  • Portal Run Time Error in Masthead

    Hello Members, I am getting Portal Runtime error on Masthead, when request goes to one of our servers. When we searched the default trace files we got the exception as below Error in service call of JSP Resource Application Name: com.xyz.prt.fin.mast

  • Songs keep skipping to next song

    I have a iPod nano 8gb. Why is it when i am listening to a song it jumps to the next song for three or more songs. What options do i have enable or disable.

  • Report alv

    Hi experts please help me to write the logic to the below requirement 1)  Identify header materials with Material Type & Plant, Material Group , Material  Number         a) Go to MARA table get the material list for material type, material group, mat

  • You can't embed QT movies into HTML!!!!

    I've been trying for 3 days now to embed a QT movie into an html doc and have had no luck. All I'm trying to do is embed a simple QT movie in an html document and then be able to load another movie by clicking a text link. I've looked at every Javasc