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

Similar Messages

  • How do I use a counter for time measurement with NI-DAQmx and C++?

    Hi,
    I need my C++ program to read time (number of elapsed ticks) using the counter on PCI-6229. I had this written and working for the non-MX driver, and now I need to re-write it for NI-DAQmx.
    Here are the steps that I want to accomplish:
    1. Route the 80MHz timebase to the input of "Dev1/ctr0"
    2. Start the counter and let it count the ticks.
    3. After a while, read the number of ticks from the counter.
    Here is how I am trying to do it now (without success):
               DAQmxCreateTask ( "" , &taskHandle ) ;
               DAQmxCreateCICountEdgesChan ( taskHandle , "Dev1/ctr0" , "" , DAQmx_Val_Rising, 0 , DAQmx_Val_CountUp ) ;
               DAQmxConnectTerms ( "/Dev1/80MHzTimebase" ,  "/Dev1/Ctr0Source" , DAQmx_Val_DoNotInvertPolarity ) ;
               DAQmxStartTask ( taskHandle ) ;
               then DAQmxReadCounterScalarU32 ( taskHandle , 0.25 , &curCount , NULL ) ;
               and DAQmxClearTask ( taskHandle ) ;
    No errors are generated, but I do not see the tick count being incremented when I repeatedly read the counter.
    Advice will be greatly appreciated!!

    Hi Peter,
    Welcome to the forums!   I just want to make sure I understand what you are trying to do.  You would like to count the rising edges of the 80 MHz clock using DAQmx in C++.  In order to route the timebase to the counter, you need to use the signal name (PFI8) instead of the counter (Ctr0Source) for the counter source input.  This name is found in Measurement Automation Explorer (MAX) by right-clicking on the device and choosing “Device Pinouts.”  This will physically put the 80 MHz clock on the PFI8 line, so make sure you reset the device or disconnect the terminals after you are done. 
    That being said, may I ask what you are trying to do by reading the number of elapsed ticks?  If you are trying to monitor a hardware timed pulse, it would be better to count the frequency or period of that pulse.  This would provide better accuracy, because you are not relying on how fast DAQmx Read can poll the hardware.  If you are simply looking for a software based timer, I would recommend taking a look at this MSDN forum post. 
    Using the GetTickCount function instead will free up your counter and provide comparable accuracy to counting the edges of the timebase.
    I hope that helps you out, let me know if you have any further questions about this. Good luck with your project.
    Rod T.

  • How to increase the thread count for JDBC adapter

    Hi ALL,
                Could someone advice me on how to increase the thread count for JDBC Adapter in Visual Admin:
    JDBC_http://sap.com/xi/XI/System.Call.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Recv.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Rqst.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Send.maxConsumers 5
    I need to increase them to 10.
    Regards,
    Xier

    hi check the below links:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/806e75a0-0e01-0010-2587-fc518de8ac1a
    admin manual:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fdb09490-0201-0010-e09e-a76388646ad0
    note:reward points if solution found helpfull.....
    regards
    chandrakanth.k

  • How to get the record count printed for the report in the Dashboards

    Hi,
    I would like to get the record count printed at the bottom of every dashboard report like:
    < 1 - 25 of 6300 > instead of < 1 - 25 >
    Any help is appreciated
    Regards
    B

    I have tried the following formula which identifies the lowest grain but it does not seem to give me correct result.. I am not getting the correct count. I am getting as 3.A work order can be updated only once at one point of time.hence the formula
    MAX(RCOUNT(CAST("SR Wo Fact"."Crm Wo Number" AS CHAR) ||CAST("SR Wo Fact"."PSC Timestamp" as char)))
    I tried only MAX(RCOUNT(1)), but I was able to get the record count as corect for Administrator but not for other users.
    Has anyone come across this scenario.
    Thanks Shravan
    Edited by: 786443 on Aug 19, 2010 10:22 AM

  • How to return the record count of a query to a number variable

    How would I get the record count from a query without using a cursor to step through the query and count the records individually?
    query: select * from table1 where column1 = column2
    How would I get the record count of the query above?
    thanks,
    michelle

    I figured it out
    select count(*) into theCount
    from ( select * from table1 where column1=column2 );
    thanks,
    michelle

  • How do install the network adaptor for windows 7 with boot camp?

    How do I install the network adaptor for windows 7 with boot camp?

    boot camp forum: https://discussions.apple.com/community/windows_software/boot_camp 

  • How to implement the record count on the page

    Dear,
    I have a basic search page, results region with a simple table.
    I need to show the total number of records returned by a search query.
    Suppose I create messageStyledText "counter" bean to show the result.
    The result will be calculated in the ProcessFormRequest, how would I set the value of the the "counter" bean then? I can not do that in PFR.
    Thank you
    Anatoliy

    In the PFR method of controller, get the row count of VO when user click on search button and then set its value in the counter bean.
    Here the dummy code.. check syntax error & other compile time error
    if(pageContext.getParameter("SearchBtn") != null)
    OAViewObject vo = (OAViewObject)am.findViewObject("SearchVO1")
    if (vo!= null)
    String fetchedRowCount = vo.getFetchedRowCount();
    OAMessageStyleTextBean msb = (OAMessageStyleTextBean)webBean.findChildRecursive("CounterBean");
    if(msb != null)
    msb.setvalue(pageContext, fetchedRowCount);
    }Thanks
    --Anil
    http://oracleanil.blogspot.com

  • How to get the record count before fetch

    CREATE PACKAGE demo_cur_pkg AS
    TYPE EmpName IS RECORD (name VARCHAR2(10));
    TYPE cur_type IS REF CURSOR RETURN EmpName;
    PROCEDURE open_emp_cur (
    curs IN OUT cur_type,
    dept_num IN NUMBER);
    END;
    CREATE PACKAGE BODY demo_cur_pkg AS
    CREATE PROCEDURE open_emp_cur (
    curs IN OUT cur_type,
    dept_num IN NUMBER) IS
    BEGIN
    OPEN curs FOR
    SELECT ename FROM emp
    WHERE deptno = dept_num
    ORDER BY ename ASC;
    END;
    END;
    After this package has been stored, you can open the cursor curs by calling the open_emp_cur stored procedure from your Pro*C/C++ program, and FETCH from the cursor in the program. For example:
    sql_cursor emp_cursor;
    char emp_name[11];
    EXEC SQL ALLOCATE :emp_cursor; /* allocate the cursor variable */
    /* Open the cursor on the server side. */
    EXEC SQL EXECUTE
    begin
    demo_cur_pkg.open_emp_cur(:emp_cursor, :dept_num);
    end;
    EXEC SQL WHENEVER NOT FOUND DO break;
    for (;;)
    EXEC SQL FETCH :emp_cursor INTO :emp_name;
    printf("%s\n", emp_name);
    Any solutioon is welcome

    Fail to understand why you want to introduce exception processing - e.g. use methodA for less than 10,000 rows and use methodB for 10,000 and more.
    Why not use methodC - optimal support for fetching, irrespective of whether there are 1 row to fetch, or a 100,000 rows?
    There is no best way for fetching a small number of rows versus a different best way for fetching more rows. There is a single optimal method - and this remains the same irrespective of the number of rows being returned.

  • How to develope  the UI design for a PDA with MI 7.0

    hi all,
    we have downloaded Windows emulator 5.0 and by follwing the link
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/5079454e-ca3e-2b10-a199-e3695d0660e5
    so now we can able to fetch the header table data but not the item table data...
    so to fetch the item table data how to develope the UI..
    as we have developed our application in Mobile Infrastructure 7.0 and that is working fine with desktop but not with emulator(windows emulator)
    so can some one inform me how to develope the application which has to work fine even with  an emulator..
    thanks and regards
    manohar

    I'm looking for documentation / How to guides for Always connected applications.
    After installing the emulator how did you proceed to the development of the application?
    any guides greatly appreciated.
    Abhijeet

  • Recording AVI for 30 seconds with compression filter

    Hi there,
    It seems to me that I have a problem. The problem contains to film a movie for 30 seconds with 30 fps. Without compression filter everything goes quite right. But with a compression filter the record time is a disaster.
    If I read this page http://digital.ni.com/public.nsf/allkb/0A4D5BF47FD3FF0186256E9A004FD671 it's quite obvious to me what the problem is: The average write time.
    After reading this I adjust the frame rate. So the play time (when you play the avi) and the the recorded time (time that you actually filmed) are the same. But I believe this is not the right solution.
    Could anyone help me with this problem?
    I use Labview 2009 with Vision Acquisition
    Thank you in advance

    Hi there,
    When you use a compression filter, your PC have to process every frame that you acquire.
    Depending on your image size, image type (color or mono) and your CPU performance, you will increase time needed between each acquired frame.
    Try different codec. But keep in mind that some only work on color images and some on mono images or both.
    You will find a VI that list all the codec installed on your computer.
    The frame rate you mentionned when you create an AVI is only an indication for the playback. It doesn't help.
    Hope this helps

  • How to restrict the record selection for PLPO table .

    Hi,
    Am selecting 'plnnr' and 'vornr' from PLPO table . For one Plnnr their are multiple Vornr including 0001 & 9999.
    I want to select only those entries which have only Vornr 0001 & 9999.
    Ex : 1) Plnnr - 5689
               Vornr - 0001,2536,8989,9999
           2) Plnnr - 8787
               vornr -  0001
           3) Plnnr - 5936
               vornr -  9999
           4) Plnnr - 2345
               vornr -  0001,9999
    Here for this example i want to select only the entry with Plnnr = 2345 as it only contains 0001 & 9999.
    Can any one let me know how to get this in a select query.
    Your help is much appreciated.
    Thanks in advance.   
    Ravi Kasnale.

    Hi
    Try with below code
    RANGES:r_vornr FOR plpo-vornr.
    TYPES:BEGIN OF ty_plpo,
    plnnr TYPE plpo-plnnr,
    vornr TYPE plpo-vornr,
    END OF ty_plpo.
    DATA:it_plpo_temp TYPE STANDARD TABLE OF ty_plpo.
    DATA:it_plpo TYPE STANDARD TABLE OF ty_plpo.
    DATA:it_plpo_temp1 TYPE STANDARD TABLE OF ty_plpo.
    DATA:wa_plpo_temp1 TYPE ty_plpo.
    DATA:v_line TYPE sy-tabix.
    START-OF-SELECTION.
      r_vornr-sign = 'I'.
      r_vornr-option = 'EQ'.
      r_vornr-low = '0000'.
      CLEAR:r_vornr-high.
      APPEND r_vornr.
      r_vornr-sign = 'I'.
      r_vornr-option = 'EQ'.
      r_vornr-low = '9999'.
      CLEAR:r_vornr-high.
      APPEND r_vornr.
      SELECT plnnr vornr FROM plpo INTO TABLE it_plpo_temp1 WHERE vornr IN r_vornr.
      CLEAR:it_plpo[].
      LOOP AT it_plpo_temp1 INTO wa_plpo_temp1.
        CLEAR:it_plpo_temp[].
        it_plpo_temp[] = it_plpo_temp1[].
        DELETE it_plpo_temp WHERE plnnr <> wa_plpo_temp1-plnnr.
        DESCRIBE TABLE it_plpo_temp LINES v_line.
        IF v_line EQ '2'.
          APPEND LINES OF it_plpo_temp TO it_plpo.
        ENDIF.
      ENDLOOP.
      SORT it_plpo BY plnnr.
      DELETE ADJACENT DUPLICATES FROM it_plpo COMPARING plnnr.
    Regards
    Srilaxmi

  • How to increase the row count for display in OBIEE Answers-Dashboard page?

    Hi All,
    I have problem in exporting my reports. I need to export my report to either PDF or EXCEL format. My report contains more than 1200 rows. But when i am exporting the report to PDF it contains only 500 rows, for rest of the rows i have to scroll down and again i have to export to get the contents from 501 to 1000.
    Is it possible by changing any property, can i export the entire 1200+ rows in a single EXCEL or PDF? Pls anybody shed light on this issue.
    Thanks in Advance
    Thenmozhi.

    Hi,
    D:\Oracle\Middleware\instances\instance1\config\OracleBIPresentationServicesComponent\coreapplication_obips1\instanceconfig.xml
    before take it u r back up and then update the below code ..
    <Views>
    <Pivot>
    <MaxCells>6500000</MaxCells>
    <MaxVisibleColumns>100</MaxVisibleColumns>
    <MaxVisiblePages>1000</MaxVisiblePages>
    <MaxVisibleRows>65000</MaxVisibleRows>
    <MaxVisibleSections>25</MaxVisibleSections>
    <DefaultRowsDisplayed>500</DefaultRowsDisplayed>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDownload>65000</DefaultRowsDisplayedInDownload>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DisableAutoPreview>false</DisableAutoPreview>
    </Pivot>
    <Table>
    <MaxCells>6500000</MaxCells>
    <MaxVisiblePages>1000</MaxVisiblePages>
    <MaxVisibleRows>65000</MaxVisibleRows>
    <MaxVisibleSections>25</MaxVisibleSections>
    <DefaultRowsDisplayed>500</DefaultRowsDisplayed>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDownload>65000</DefaultRowsDisplayedInDownload>
    </Table>
    </Views>
    finally re start all services then try it again... here its working fine...
    Thanks
    Deva

  • How much is the OOW replacent for iPhone 5c with liquid damage?

    I dropped my phone in a water puddle and I just want to know the price for a replacement .

    Check this:
    Model
    Out-of-warranty service fee
    Battery service*
    iPhone 6 Plus
    $329
    $79
    *available only if battery
    fails Apple’s diagnostic test
    iPhone 6
    $299
    iPhone 5s, iPhone 5c, iPhone 5
    $269
    iPhone 4s
    $199
    iPhone 4, iPhone 3GS, iPhone 3G,
    Original iPhone
    $149
    Plus a $6.95 shipping fee, if required. Fees are in USD and exclude local tax. Pricing is for service through Apple. The final service fee we charge will be determined during testing and may be less than the service fee listed above. Pricing and terms vary for service through an Apple Authorized Service Provider.
    copied from Apple - Support - Service Answer Center

  • Get the record count from a query

    Hi,
    does anyone know how to get the record count from a sql query?
    e.g: I've got a ResultSet from the Statement.excuteQuery(), and I want to know how many records this ResultSet contains, how to get this?
    I'd read thoughout the documents of Statement and ResultSet, but couldn't find a solution, do I have to use another seperate query such as "select count(*)" to do this?
    thanks.
    Yang Liu

    If you are not using a scrollable result set then the following is the best way to do it.
    there are several key words in SQL that can be used, the one you are interested in is count();
    so if your query at the moment is
    "select col1, col2, col3 from my_table where col2=? and col3=?"you can work out how many rows will be returned by executing this command first
    "select count(col1) from my_table where col2=? and col3=?"this will return a result set with one row and one column, you can get the row count as follows:
    ResultSet rs = ps.executeQuery();
    int rowCount = rs.getInt(1);I hope this helps :)

  • How can I get the shutter count for my Canon 7D Mark II using Windows XP?

    How can I get the shutter count for my Canon 7D Mark II using Windows XP? I've been looking lots of places and doing some file uploads, but I can't seem to find anything. I'm wary of downloading software I know nothing about. Any help is greatly appreciated.
    Solved!
    Go to Solution.

    Nevermind, just, sort of answered my own question. Doesn't work on XP, but using a Win 7 'puter I was able to use Shutter Count, which now works w/ the 7D Mark II.

Maybe you are looking for

  • Chrome fails install on Windows 8.1

    For several weeks now Chrome has failed on my Windows 8.1 OS. I tried reinstalling but I wasn't sucessful.

  • How to get status of a backup job

    Hello everybody, I scheduled our daily RMAN backup using the DBMS_SCHEDULER package. The DB job calls an external batch file which in turns calls rman's executable and passes it a command file containing the actual backup script. Similar to what's de

  • Reg:terms of payments

    Hi,      I am having a call regarding payment terms : Actually  terms of payments will calculated on the billing date but the my issue is to calculate on the POD basis. let me know it is possible in standard sap-sd or not,If yes can you give me a sug

  • Projects and Referenced Images

    Hi - I have been using APerture 1.5.6 for a while but am suddenly confused and have several questions: 1)Most of my images are Referenced and exist on my hard drive in various folders with various titles. If I get rid of the Aperture Library, my refe

  • OVM Server 2.1.2 does not prompt for Networking

    OVM Server 2.1.2 does not prompt for a network setup (ie DHCP or static IPs). - I tried re-installing this several times This same machine works with native Enterprise Linux 5.2 x86-64 networking. The motherboard has two onboard Realtek 8111C chips (