Count distinct users registered

Hello

I have a table that contains the users and their hours of connection and disconnection. I need to know the maximum number of distinct users connected for a period of 15 minutes for each day. Periods of 15 minutes, start at 00:00 and ends at 23:45
WITH user_data AS
(SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 11:57', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 12:34', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 12:18', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 12:23', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 12:41', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 13:20', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 13:22', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 15:12', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 13:25', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 13:26', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER2' user_id, TO_DATE('01-DEC-2010 13:27', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 13:30', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 13:34', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 15:08', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 13:53', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 16:38', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER3' user_id, TO_DATE('01-DEC-2010 14:00', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('22-FEB-2011 14:18', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 14:14', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 15:20', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 14:15', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 15:21', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 14:23', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 15:29', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 14:30', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 19:12', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 14:36', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 15:46', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 14:39', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 16:40', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('01-DEC-2010 14:44', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('01-DEC-2010 16:08', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 09:10', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 12:25', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 09:52', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 13:01', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 10:03', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 13:08', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 10:37', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 11:53', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER2' user_id, TO_DATE('02-DEC-2010 10:40', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 12:01', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 10:54', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 10:59', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 10:55', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 11:02', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 10:59', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 11:00', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER2' user_id, TO_DATE('02-DEC-2010 11:00', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 12:58', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 11:20', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 13:12', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 11:45', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 14:18', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 11:53', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 13:10', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 11:57', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 12:54', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 12:01', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 12:54', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 12:09', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 13:37', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER3' user_id, TO_DATE('02-DEC-2010 12:12', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 12:13', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 12:54', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 15:58', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 13:12', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 13:19', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 13:13', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 15:11', 'DD-MON-YYYY HH24:MI') logout_date FROM dual UNION ALL
 SELECT 'USER1' user_id, TO_DATE('02-DEC-2010 13:22', 'DD-MON-YYYY HH24:MI') login_date, TO_DATE('02-DEC-2010 13:50', 'DD-MON-YYYY HH24:MI') logout_date FROM dual),
pivs AS
(SELECT 0 piv_num FROM dual UNION ALL
 SELECT 1 piv_num FROM dual UNION ALL
 SELECT 2 piv_num FROM dual UNION ALL
 SELECT 3 piv_num FROM dual UNION ALL
 SELECT 4 piv_num FROM dual UNION ALL
 SELECT 5 piv_num FROM dual UNION ALL
 SELECT 6 piv_num FROM dual UNION ALL
 SELECT 7 piv_num FROM dual UNION ALL
 SELECT 8 piv_num FROM dual UNION ALL
 SELECT 9 piv_num FROM dual UNION ALL
 SELECT 10 piv_num FROM dual UNION ALL
 SELECT 11 piv_num FROM dual UNION ALL
 SELECT 12 piv_num FROM dual UNION ALL
 SELECT 13 piv_num FROM dual UNION ALL
 SELECT 14 piv_num FROM dual UNION ALL
 SELECT 15 piv_num FROM dual UNION ALL
 SELECT 16 piv_num FROM dual UNION ALL
 SELECT 17 piv_num FROM dual UNION ALL
 SELECT 18 piv_num FROM dual UNION ALL
 SELECT 19 piv_num FROM dual UNION ALL
 SELECT 20 piv_num FROM dual UNION ALL
 SELECT 21 piv_num FROM dual UNION ALL
 SELECT 22 piv_num FROM dual UNION ALL
 SELECT 23 piv_num FROM dual UNION ALL
 SELECT 24 piv_num FROM dual UNION ALL
 SELECT 25 piv_num FROM dual UNION ALL
 SELECT 26 piv_num FROM dual UNION ALL
 SELECT 27 piv_num FROM dual UNION ALL
 SELECT 28 piv_num FROM dual UNION ALL
 SELECT 29 piv_num FROM dual UNION ALL
 SELECT 30 piv_num FROM dual UNION ALL
 SELECT 31 piv_num FROM dual UNION ALL
 SELECT 32 piv_num FROM dual UNION ALL
 SELECT 33 piv_num FROM dual UNION ALL
 SELECT 34 piv_num FROM dual UNION ALL
 SELECT 35 piv_num FROM dual UNION ALL
 SELECT 36 piv_num FROM dual UNION ALL
 SELECT 37 piv_num FROM dual UNION ALL
 SELECT 38 piv_num FROM dual UNION ALL
 SELECT 39 piv_num FROM dual UNION ALL
 SELECT 40 piv_num FROM dual UNION ALL
 SELECT 41 piv_num FROM dual UNION ALL
 SELECT 42 piv_num FROM dual UNION ALL
 SELECT 43 piv_num FROM dual UNION ALL
 SELECT 44 piv_num FROM dual UNION ALL
 SELECT 45 piv_num FROM dual UNION ALL
 SELECT 46 piv_num FROM dual UNION ALL
 SELECT 47 piv_num FROM dual UNION ALL
 SELECT 48 piv_num FROM dual UNION ALL
 SELECT 49 piv_num FROM dual UNION ALL
 SELECT 50 piv_num FROM dual UNION ALL
 SELECT 51 piv_num FROM dual UNION ALL
 SELECT 52 piv_num FROM dual UNION ALL
 SELECT 53 piv_num FROM dual UNION ALL
 SELECT 54 piv_num FROM dual UNION ALL
 SELECT 55 piv_num FROM dual UNION ALL
 SELECT 56 piv_num FROM dual UNION ALL
 SELECT 57 piv_num FROM dual UNION ALL
 SELECT 58 piv_num FROM dual UNION ALL
 SELECT 59 piv_num FROM dual UNION ALL
 SELECT 60 piv_num FROM dual UNION ALL
 SELECT 61 piv_num FROM dual UNION ALL
 SELECT 62 piv_num FROM dual UNION ALL
 SELECT 63 piv_num FROM dual UNION ALL
 SELECT 64 piv_num FROM dual UNION ALL
 SELECT 65 piv_num FROM dual UNION ALL
 SELECT 66 piv_num FROM dual UNION ALL
 SELECT 67 piv_num FROM dual UNION ALL
 SELECT 68 piv_num FROM dual UNION ALL
 SELECT 69 piv_num FROM dual UNION ALL
 SELECT 70 piv_num FROM dual UNION ALL
 SELECT 71 piv_num FROM dual UNION ALL
 SELECT 72 piv_num FROM dual UNION ALL
 SELECT 73 piv_num FROM dual UNION ALL
 SELECT 74 piv_num FROM dual UNION ALL
 SELECT 75 piv_num FROM dual UNION ALL
 SELECT 76 piv_num FROM dual UNION ALL
 SELECT 77 piv_num FROM dual UNION ALL
 SELECT 78 piv_num FROM dual UNION ALL
 SELECT 79 piv_num FROM dual UNION ALL
 SELECT 80 piv_num FROM dual UNION ALL
 SELECT 81 piv_num FROM dual UNION ALL
 SELECT 82 piv_num FROM dual UNION ALL
 SELECT 83 piv_num FROM dual UNION ALL
 SELECT 84 piv_num FROM dual UNION ALL
 SELECT 85 piv_num FROM dual UNION ALL
 SELECT 86 piv_num FROM dual UNION ALL
 SELECT 87 piv_num FROM dual UNION ALL
 SELECT 88 piv_num FROM dual UNION ALL
 SELECT 89 piv_num FROM dual UNION ALL
 SELECT 90 piv_num FROM dual UNION ALL
 SELECT 91 piv_num FROM dual UNION ALL
 SELECT 92 piv_num FROM dual UNION ALL
 SELECT 93 piv_num FROM dual UNION ALL
 SELECT 94 piv_num FROM dual UNION ALL
 SELECT 95 piv_num FROM dual UNION ALL
 SELECT 96 piv_num FROM dual UNION ALL
 SELECT 97 piv_num FROM dual UNION ALL
 SELECT 98 piv_num FROM dual UNION ALL
 SELECT 99 piv_num FROM dual)
SELECT   s2.cdate,
         MAX(s2.user_count)
FROM    (SELECT TO_CHAR(t.cdate, 'DD-MON-YYYY') cdate,
                SUM(LEAST(t.user_count, 1)) user_count
         FROM  (SELECT   TO_DATE('01-DEC-2010', 'DD-MON-YYYY') + p1.piv_num cdate,
                         TO_CHAR(TO_DATE((p2.piv_num * 15) * 60, 'SSSSS'), 'HH24:MI') time,
                         SUM(CASE WHEN TRUNC((TO_DATE('01-DEC-2010', 'DD-MON-YYYY') + p1.piv_num) + (p2.piv_num * 15)/1440, 'MI') BETWEEN s.login_date and s.logout_date THEN 1 ELSE 0 END) user_count
                FROM     pivs p1,
                         pivs p2,
                        (SELECT user_id,
                                login_date,
                                logout_date
                         FROM   user_data) s
                WHERE    p1.piv_num < 2 -- number of days I want to look at i.e. 01-DEC-2010 and 02-DEC-2010
                AND      p2.piv_num < 96 -- number of 15 minute periods in a day i.e. 00:00 to 23:45
                GROUP BY p1.piv_num,
                         p2.piv_num,
                         s.user_id
                ORDER BY p1.piv_num,
                         p2.piv_num) t
         GROUP BY t.cdate,
                  t.time) s2
GROUP BY s2.cdate
ORDER BY TO_DATE(s2.cdate)
/
For the above test data, I expect to see:
Date        Users
----------- -----
01-DEC-2010     2
02-DEC-2010     3
The code above works, but I'm sure there must be a better way to do it, I can't see how...

Lee

Hello

Here's one way:

WITH     parameters  AS
(
     SELECT  TO_DATE ( '01-Dec-2010'               -- Starting time (included in output)
               , 'DD-Mon-YYYY'
               )     AS start_dt
     ,       TO_DATE ( '03-Dec-2010'               -- Ending time (NOT included in output)
               , 'DD-Mon-YYYY'
               )     AS end_dt
     ,     24 * 4          AS periods_per_day
     FROM     dual
)
,     periods          AS
(
     SELECT     start_dt + ((LEVEL - 1) / periods_per_day)     AS period_start
     ,     start_dt + ( LEVEL      / periods_per_day)     AS period_end
     FROM     parameters
     CONNECT BY     LEVEL <= (end_dt - start_dt) * periods_per_day
)
,     got_cnt_per_period     AS
(
     SELECT       p.period_start
     ,       COUNT (distinct user_id)     AS cnt
     ,       ROW_NUMBER () OVER ( PARTITION BY  TRUNC (period_start)
                                   ORDER BY      COUNT (*)   DESC
                           ,               period_start
                                )         AS rnk
     FROM       periods     p
     JOIN       user_data     u  ON   p.period_start     <= u.logout_date
                       AND     p.period_end     >  u.login_date
     GROUP BY  p.period_start
)
SELECT       period_start
,       cnt
FROM       got_cnt_per_period
WHERE       rnk     = 1
ORDER BY  period_start
;

You will notice that it does not use the pivs table. Generate periods of time with a CONNECT BY query is likely to be more effective, and you don't have to worry about having enough rows in the table pivs.
In this way avoids also all conversions between DATEs and strings (except for the entrance of the start_dt and end_dt parameters), which should take some time.

If you are actually hardcode the parameters in the query, the abopve version will be easier to use and maintain, because each parameter only has to register once, in the first auxiliary request.

The output includes the start time of the period who had the highest number on each day. If there are equal (as in this example of data, there were 3 periods December 1, which had a number of 2), then the specified period is that earlier that day. If you want to see all, replace ROW_NUMBER RANK by the last auxiliary request, got_cnt_per_peroid. Of course, you don't have to display the time if you do not want.

Tags: Database

Similar Questions

  • Number of distinct users

    I have the following table

    UsersRegion
    [email protected]EMEA
    SSA. [email protected]APAC
    SSA. [email protected]APAC
    [email protected]EMEA
    [email protected]EMEA
    [email protected]DVL
    [email protected]DVL
    [email protected]EMEA
    [email protected]EMEA
    [email protected]EMEA

    I need to know the number of distinct users by region.

    If the result will give me EMEA - 5

    APAC - 1

    LAD - 1

    Can someone help me with the query?

    Hello

    You said.  A way of counting distinct users is COUNT (DISTINCT users):

    SELECT region

    COUNT (DISTINCT users)

    FROM table_x

    GROUP BY region;

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT only relevant columns statements) and the results desired from these data.
    Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.
    If you change the query at all, post your modified version.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

  • Count Distinct on a window

    Hello world

    I read an article about a measure of viscosity (http://www.seomoz.org/blog/tracking-browse-rate-a-cool-stickiness-metric). It's basically a way to measure how well you attract people to your Web site.

    Viscosity for the last 7 days: (County of different users today) / (number of distinct users for the last 7 days)
    Viscosity for the last 30 days: (County of different users today) / (number of distinct users for the last 30 days)

    I have a table called WC_WEB_VISITS_F that is in the grain of the user's visit to one of my web sites.

    Is there a way I can use OBIEE to calculate values above?

    I can get the numerator. I create a logical column called count of separate to everyday users and aggregation set to Distinct Count on USER_ID and then I pivot my report to the Date of visit.

    I can't understand how Distinct Count for X days. If there were separate count for this month, I just copy the count of distinct daily users and set the content to the month level, however, it is a floating range, I can't do that.

    Does anyone have an idea of Cleaver for this?

    Thank you!

    -Joe

    11g is the function PERIODROLLING, which is the answer to all these requirements. The PERIODROLLING function allows you to perform an aggregation on a specified set of periods of grain of query rather than a grain of fixed time series. The most common use is to create rolling averages, as "13-week Rolling average." With 10 all we will get is a feature limited according to solutions...

  • OVERALL TOTAL incorrect (with COUNT DISTINCT)

    Hello

    I get incorrect results in a DISTINCT COUNT measure column GRAND TOTAL.

    I have 5 separate in Paris and 10 separate clients in New York, I want the grand total for the sum of the two, it is 15.
    But OBIEE calculates separate customers for all cities, so if there are customers in Paris and New York, the result is false.


    This is the result I get:

    City Number_Distinct_Customers
    ----------------------------------------------------------------------------
    Paris 5
    NEW YORK CITY 10
    GRAND TOTAL 12


    12 is the number of all separate clients.

    The correct GRANT TOTAL is expected to be 5 + 10 = 15



    Thank you
    Concerning

    I guess that COUNT(DISTINCT...) is regarded as the default aggregation in the Oracle replies.
    To come in this, change the State of aggregation of fx (formula column in the criteria of answers tab) to 'SUM '...

    Let me know if that solves your problem.
    -bifacts :-)
    http://www.obinotes.com

  • How to count distinct exclusion of a value in the business layer?

    Hi all

    I have a column that has a lot of values. I need to do is a measure with aggregator separate count. But I shouldn't count 0 in the column. How can I do that. If I try to use any way to condition the aggregator option is disable. Help, please

    Thank you

    Look at this example:

    I did MDB table is DIRTY as:

    Count_Distinct_Prod_Id_Exclude_Prod_Id_144

    I'll count distinct PRODUCTS. PROD_ID, but exclude PROD_ID = 144 when counting.

    Make this measure like this:

    1. new column object/logic
    2. go in tab data type and click EDIT the table logic table source
    3. now, in the general tab add join of a table (in my case of PRODUCTS)
    4. go in the column mapping tab-> see the deleted column mapping

    5. in the new column (in my case Count_Distinct_Prod_Id_Exclude_Prod_Id_144) write similar code:
    CASE WHEN "orcl". » ». "" SH ". "PRODUCTS '." "' PROD_ID ' = 144 THEN ELSE NULL"orcl ". » ». "" SH ". "PRODUCTS '." "' PROD_ID ' END

    6. click OK and close the source logical table
    7. now, in the logical column window go to the tab of the aggregation and choose COUNT DISTINCT.

    8. move the Count_Distinct_Prod_Id_Exclude_Prod_Id_144 measure for presentation

    9 test answers (report cointains columns as follows)

    PROD_CATEGORY_ID
    Count_Distinct_Prod_Id_Exclude_Prod_Id_144

    And the result in the NQQuery.log is:

    Select T21473. PROD_CATEGORY_ID C1,
    Count (distinct from cases when T21473.) PROD_ID is 144, then NULL else T21473. End PROD_ID) C2
    Of
    PRODUCTS T21473
    Group of T21473. PROD_CATEGORY_ID
    order of c1

    Concerning
    Goran
    http://108obiee.blogspot.com

  • COUNT (DISTINCT &lt; nom_de_colonne &gt;)

    I would like to display the count (DISTINCT < company >) at the end of the report. I use a SQL query in the form of data / the whole model. Thanks in advance.

    NEW YORK CITY
    JANUARY 1, 2008

    Company ID DIFF
    ABC 1-1
    2 2 XYZ
    ABC 3-1

    FEBRUARY 1, 2008

    Company ID DIFF
    MNO 1-1
    2 2 XYZ
    MNO 3-1

    Total number of companies: 3

    Use this

  • Vs Count Distinct Count

    What is the difference between the meter and the meter separate in the advanced INTERFACE

    Operations-> all settings-> deployed-> Count?

    This metric is available in the advanced user interface and the custom user interface. Measures are not read in the Admin UI.

    Distinct count is the actual number of virtual machines deployed, while the County is # trend / forecasting of the deployed virtual machines. Usually, you will notice the separate account doesn't have a very clear dynamic threshold, but the County has a dynamic rise. Speaking of which, I would say probably a couple more VMs to meet forecasts of my lab... ha.

  • Delete the user registered on the Web site ID

    original title: list of the userids

    When you go to different Web sites that require user id connections, I find that when you click in the neighborhood newspaper, all signs, sign user names appear.  Is there a way to remove this option?

    Hi NJ123,

    • What browser you use on the computer.

    Try the step below only if you are using Internet explorer as your web browser.

    You can delete all store passwords and other information that you type in the fields of web form using the AutoComplete feature in internet explore.

    When Internet Explorer starts, AutoComplete is disabled. To turn it on or off, follow these steps:

    1. Open Internet Explorer by clicking the Start button and then about Internet Explorer.
    2. Click Tools and then click Internet Options.
    3. Click the content tab.
    4. Under AutoComplete, click settings.
    5. Click delete AutoComplete history.
    6. Click OK, and then click OK again.

    Fill in website forms and passwords automatically

    http://Windows.Microsoft.com/en-us/Windows-Vista/fill-in-website-forms-and-passwords-automatically

    Note: Above article also applies to Windows XP.

  • Count of users of database in the case of MOHAMED Licensing

    Hello

    I wanted to know how Oracle goes on the number of users of a database.

    What, out of what follows, says to explain the use?

    1. all entries in table DBA_USER

    2. all the OPEN and ASSETS entered in the DBA_USER table

    or

    3 stats SESSION_HIGHWATER

    Thanks in advance,

    T

    user13405592 wrote:

    In my view, that there is a vijayan Hemant K collection & Ajay of confusion.

    I ask with respect to an audit of Oracle's LMS. How did they check my user base?

    They will ask you: how many people (and devices) use the product?

  • Two distinct users of Adobe Muse sharing site

    How two users with different Adobe ID, share, and work on the same Web site created by Muse? A user created the site for more than a year and asks to help him maintain. Another user also has an Adobe ID with Muse bought and downloaded separately. They both require access to the same files/site independently (and not at the same time, of course).

    Hello

    Same file Muse can be published on various sites, but I think what you want that both users should be able to manage the site of Muse, as well at the end of the published site.

    If the site is hosted on external server then the two users must have access to the server so that they can download the Muse site update in the root of the site.

    If the site is published to Business Catalyst, then ask the previous user who has created the site to add two new users as an administrator for the users of the portal site or partner and they can also make modifications on the site of Muse and publish on the same site.

    Thank you

    Sanjit

  • Maximum, Count Distinct functions in the model.

    Hello

    I have a set of data that I tried to regroup for a report.
    I need in the report so that I have product code list in a column and Max (Product Code) in another column product code, product code Sub are strings and not numbers.


    Suppose that my data set has


    product code:-product-sub-code
    ____________________________

    ABC | 1A
    ABC | 1 b
    ABC | 1 c
    def | 1 B
    def | 2B
    def | 2 c
    ...
    ...
    ....
    ...
    ...

    I need to report

    ABC | 1A
    def | 2B

    ..



    I gathered it and I tried to show the Max (product code) for the current group. But it gave me a number instead of text. I tried to select 'text' to the form field. But it is automatically change the number.


    Also, can you let me know how to write the number (code of separate by-product). I must also add that column.

    I can't add in SQL because there are tons of models on this data set. I have to do it in the model.

    Any help is greately appreciated.

    Try using this: -substitute your domain under product code name

    Thank you
    Bipuser

  • Several group

    Hello

    Could someone tell me how I might have several group from the different count function?
    Here's what I'm trying to do.

    select x.prev_categ, x.next_categ,
           count(distinct user_id) as countprev2next,
           count(distinct user_id) as countprev2any,
           count(distinct user_id) as countany2next,
           count(distinct user_id) as countany2any
    (
         select user_id, prev_categ,  next_categ,
                   dense_rank() over (order by prev_categ, next_categ) as rankprev2next,
                   dense_rank() over (order by prev_categ) as rankprev2any,
                   dense_rank() over (order by next_categ) as rankany2next,
                   dense_rank() over() as rankany2any
            from next_categ_data
            where x.prev_categ IS NOT NULL and x.next_categ IS NOT NULL
    )x
    group by x.prev_categ, x.next_categ
    ;
    In the group by clause, I would like to have group by in the following terms:
    (1) prev_categ and next_categ as shown in the query
    (2) only prev_categ
    (3) only next_categ
    (4) user_id

    By this motion, I am trying to accomplish the following:
    For example, I have a transaction in which category A is passed to category B.
    I want to count distinct users who moved from category:
    (1) A to B (A2B)
    (2) A to any category (A2X)
    (3) any to B (X2B)
    (4) all for the whole (X2X)

    This must be done for all possible transactions.
    Sample Data
    create table final as
    
    (
    select 1 user_id,2 product_id,A categ_id, to_Date('1/1/2009','MM/DD/YYYY') dt from dual union all
    select 1 user_id,3 product_id,B categ_id, to_Date('1/1/2009','MM/DD/YYYY') dt from dual union all
    select 1 user_id,4 product_id,C categ_id, to_Date('1/3/2009','MM/DD/YYYY') dt from dual union all
    select 1 user_id,5 product_id,D categ_id, to_Date('1/3/2009','MM/DD/YYYY') dt from dual union all
    select 1 user_id,6 product_id,E categ_id, to_Date('1/3/2009','MM/DD/YYYY') dt from dual union all
    select 1 user_id,7 product_id,F categ_id, to_Date('1/10/2009','MM/DD/YYYY') dt from dual union all
    select 1 user_id,8 product_id,G categ_id, to_Date('1/11/2009','MM/DD/YYYY') dt from dual union all
    
    select 2 user_id,2 product_id,A categ_id, to_Date('1/1/2009','MM/DD/YYYY') dt from dual union all
    select 2 user_id,3 product_id,B categ_id, to_Date('1/2/2009','MM/DD/YYYY') dt from dual union all
    select 2 user_id,4 product_id,C categ_id, to_Date('1/4/2009','MM/DD/YYYY') dt from dual union all
    select 2 user_id,5 product_id,F categ_id, to_Date('1/5/2009','MM/DD/YYYY') dt from dual union all
    select 2 user_id,6 product_id,H categ_id, to_Date('1/6/2009','MM/DD/YYYY') dt from dual union all
    select 2 user_id,7 product_id,F categ_id, to_Date('1/12/2009','MM/DD/YYYY') dt from dual union all
    select 2 user_id,8 product_id,G categ_id, to_Date('1/15/2009','MM/DD/YYYY') dt from dual union all
    
    select 3 user_id,2 product_id,A categ_id, to_Date('1/11/2009','MM/DD/YYYY') dt from dual union all
    select 3 user_id,3 product_id,C categ_id, to_Date('1/12/2009','MM/DD/YYYY') dt from dual union all
    select 3 user_id,4 product_id,B categ_id, to_Date('1/13/2009','MM/DD/YYYY') dt from dual union all
    
    ) ;
    Sample output
    Prev_categ | Next_categ | countprev2next | countprev2any | countany2next | countany2any
    ---------------------------------------------------------------------------------------
      A            B              2                 3              3               3
      A            C              1                 -              3               3
      B            C              2                 2              -               3
      C            B              1                 3              -               3
      C            D              1                 -              1               3
      C            F              1                 -              2               3
      D            E              1                 1              1               3
      E            F              1                 1              -               3
      F            G              2                 2              2               3
      F            H              1                 -              1               3
      H            F              1                 1              -               3
    Could you also tell me how I could make the County be repeated? For example, I want to count 3 to print for the two A to B and a-C
    under column of prev2any.

    I appreciate all help.

    Thanks again,

    Hello

    You can do it with the analytical COUNT function:

    SELECT DISTINCT
    ,       prev_categ
    ,       next_categ
    ,       COUNT (DISTINCT user_id) OVER (PARTITION BY prev_id
                              ,           next_id
                             )               AS countprev2next
    ,       COUNT (DISTINCT user_id) OVER (PARTITION BY prev_id)     AS countprev2any
    ,       COUNT (DISTINCT user_id) OVER (PARTITION BY next_id)     AS countany2next
    ,       COUNT (DISTINCT user_id) OVER ()               AS countany2any
    FROM       next_categ_data
    WHERE       next_categ     IS NOT NULL
    ORDER BY  prev_categ
    ,       next_categ
    ;
    

    Sorry, I'm not a database now, so I can't test it for 12 hours.

    Looking at the code you posted, it seems as if you were on the right track with the partitions, only you were trying the wrong analytical function.

    You really have a table like next_categ_data? Most people would use a view, if this isn't a subquery for this, unless the query speed was very important.

  • meter registered user

    Is it possible to add a counter users registered on my site of muse?

    What catalyst for business package is the most suitable for this option?

    I need of the saving options and password only for customers.

    Ciao

    Geoff

    If you are looking to use the CRM features as well as the ability to create secure areas to ensure certain pages through a system of registration/login, webMarketing BC plan or above would be the way to go, see this thread - http://forums.adobe.com/message/5552081. However, please note that there is no native integration of such features within the Muse CMS and put all this is more of a manual process much easier to follow.

    Unfortunately, it is not a module in British Colombia which would be a counter users registered to the output interface.

    Thank you

    Vinayak

  • Distinct count every time a month goes to the rear

    Hello

    I'm trying to find a good way to turn a repetitive motion to something a little more streamlined. Basically, I need generate the output of distinct users all the time per month, so if I ran the query as I would like to:

    Select (separate cd. INVESTIGATION period), "Jan," such as 'Month', cd.state, cd.zip
    from the cd from mytable
    where cd.date < to_date('20120101090001','yyyymmddhh24miss')

    can I change the date back a month and the name of 'Months' and the same union query.

    Any ideas?

    918455 wrote:
    The only problem I see is that when I want to group by zip code, etc.

    Then add the code postal etc to the PARTITION BY clause:

    with mytable as (
                     select 55 user_id,to_date('3/1/2012','mm/dd/yyyy') DateOfActivity from dual union all
                     select 45,to_date('2/1/2012','mm/dd/yyyy') from dual union all
                     select 45,to_date('2/3/2012','mm/dd/yyyy') from dual union all
                     select 45,to_date('1/1/2012','mm/dd/yyyy') from dual union all
                     select 25,to_date('2/1/2012','mm/dd/yyyy') from dual union all
                     select 25,to_date('2/3/2012','mm/dd/yyyy') from dual union all
                     select 35,to_date('1/1/2012','mm/dd/yyyy') from dual union all
                     select 35,to_date('12/1/2011','mm/dd/yyyy') from dual
                    ),
               t as (
                     select  first_value(DateOfActivity) over(partition by user_id,zipcode order by DateOfActivity) FirstOccurrence,
                             zipcode,
                             DateOfActivity
                       from  mytable
                    )
    select  distinct trunc(DateOfActivity,'MM') MonthOfActivity,
                     zipcode,
                     count(case DateOfActivity when FirstOccurrence then 1 end) over(partition by zipcode order by DateOfActivity) NumUsers
      from  t
      order by MonthOfActivity
    /
    

    SY.

  • How oracle to count the number of users of Hyperion

    Hello

    Can I find out how Oracle count of users for Hyperion Planning? I disabled some dummy accounts in the Production environment, but they exist the planning app security group. Will be what they considered authorized users?

    Thank you

    As I see it is provisioned to users who could potentially access the system, so I assumed that disabled accounts could not access to the system so don't are not counted, just my opinion, I do not speak for Oracle

    As suggested, it always better to speak to the representative of account for any clarification.

Maybe you are looking for