Count on column month function gives bad result

Hello

I'm on OBIEE 11.1.1.7.150120.

I used the count on the column for the month function and instead of getting 12 as the answer I get 365. (I used a filter on the column year to restrict to one year)

How could it happen?

Any help would be appreciated.

A count on your back 1661600 fact table is not strange because it is normal to have a ton of lines (zero, one or more for each value of your dimensions).

If you look at the physical SQL what is it? 365 days is because of 1 line of time Sun has multiple matches on your fact table or is dim because your time is at the level of the day (again 365 is really a strange number: exactly the number of days in the year...).

But the distinct count is your solution, because as soon as your will a request using your time and dimension of any other table with County you will count the number of lines and not the number of months.

Tags: Business Intelligence

Similar Questions

  • LEFTOUTER join querry which gives bad result

    Hello

    I have tables like below.when I perform a left outer join issue IDs and startdate he gives invalid results.when I write in request

    It does not correct result because there is no data for 16 jan. It should give no results. But it shows all records. How do I solve this problem

    SQL:

    Select a.id, a.date, b.val, a.tot, b.net, b.cre

    FROM table1 a

    join table2 b left

    "on a.id = b.id and a.date = b. and a.date ='02-Feb-2014."

    In the tables below contains no data for the month of February but still im getting the incorrect data. He must not returnany files right?

    Table1:

    IDDateValtot
    1January 1, 1319
    22 January 1338
    33 January 1347
    4January 4, 1356
    55 January 1365

    Table2:

    IDDateNETCRE
    1January 1, 1319
    213 January 1338
    33 January 1347
    4January 4, 1356
    55 January 1365

    "It should not returnany files right?

    Wrong, there is no where clause so it should return all the records in a padded with NULL values for b.

  • view inline values, which gives bad result...

    I saw a123 table with data below...


    GRANTAMOUNTDRCR
    112341000D
    212345000C
    3123452000C
    4123457000D



    Now I want below o/p of the table of the a123


    GRANTBALANCE
    1234-4000
    12345-5000

    To do this, I wrote below the query but its appropriate result not give...

    Select grant, credit-debit balance of)

    Select grant, sum (debit) Debit, sum (credit) credit of)

    Select grant,

    Drcr case when 'C' THEN amount *-1 Else NULL END in the form of credit.

    Drcr case when had ' then amount end otherwise null flow

    from a123)

    Grant group);

    top query results are below...

    GRANTBALANCE
    112346000
    2123459000

    Please help me on this thanks...

    Pretty obvious what is wrong:

    you convert credit figures in negative numbers with the case statement

    If you have

    1 1234 1000 D
    2 1234 -5000 C
    3 12345 -2000 C
    4 12345 7000 D

    and after that you are subtracting these figures of your throughput numbers.

    Therefore, do not convert negative credits before subtracting the or if you want to make negativ, then you must add them.

    1000 + 5000 =-4000

    1000-5000 = 6000

    HTH

  • Text index CONTEXT Oracle which gives bad results!

    Expert Oracle Text,

    I'm on Oracle 11.2.0.2 on Solaris 10 and have implemented the Oracle text features using the CONTEXT index type, and I'm getting a few problems in. I have a need for research with joker as % and giving the wrong exit. Here's the scenario where I get incorrect results:
     
    
    --creating preferences etc 
    exec   ctxsys.ctx_ddl.create_preference ('cust_lexer', 'BASIC_LEXER'); 
    exec   ctxsys.ctx_ddl.set_attribute ('cust_lexer', 'base_letter', 'YES'); -- removes diacritics 
    exec   ctxsys.ctx_ddl.create_preference ('cust_wl', 'BASIC_WORDLIST') 
    exec   ctxsys.ctx_ddl.set_attribute ;    ('cust_wl', 'SUBSTRING_INDEX', 'true'); 
    
    --table set up 
    CREATE TABLE TEST_USER 
    ( 
      FULL_NAME  VARCHAR2(64 CHAR)                  NOT NULL, 
      LAST_NAME  VARCHAR2(64 CHAR)                  NOT NULL 
    ); 
    
    
    CREATE INDEX TEST_USER_IDX5 ON TEST_USER 
    (FULL_NAME) 
    INDEXTYPE IS CTXSYS.CONTEXT 
    PARAMETERS('LEXER cust_lexer WORDLIST cust_wl SYNC (ON COMMIT)'); 
    
    --data set up 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Supervisor upervisor', 'upervisor'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('JOSEPH WILSON', 'WILSON'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('CHRISTOPHER Phil', 'TAYLOR'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('PAUL HERNANDEZ', 'HERNANDEZ'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Betty Jipes', 'Jones'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('One Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Three Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Two Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Four Anna', 'Anna'); 
    Insert into TEST_USER 
       (FULL_NAME, LAST_NAME) 
    Values 
       ('Gary Barrow', 'Barrow'); 
    COMMIT; 
    
    --query using CONTAINS which gives WRONG output - because out intention is to return only those strings that START WITH the letter P but it returns another string that has P not at the starting!! 
    
    SQL> select full_name from test_user where contains(full_name,'P%')>0; 
    
    FULL_NAME 
    ---------------------------------------------------------------- 
    PAUL HERNANDEZ 
    CHRISTOPHER Phil 
    
    -- I need output as follows in which the second value is not returned...meaning 'CHRISTOPHER Phil' should NOT be returned by the CONTAINS clause just as the LIKE operator below doesn't return it. 
    SQL> select full_name from test_user where full_name like 'P%'; 
    
    FULL_NAME 
    ---------------------------------------------------------------- 
    PAUL HERNANDEZ 
    Please can anyone suggest what to do about it?

    Thank you
    OrauserN

    No, you can skip all those, if you use SUBSTRING_INDEX.

  • Find text in secure file gives bad result

    I'm usung Adobe Reader 10.1.4 with Windows 7 32 bit.  When I try to find the text, I get a wrong result if the PDF is secured.  I get the correct result in a file that is not guaranteed.  The same search for the secure file works on another PC also running Adobe Reader 10 and Windows 7.  I uninstalled Adobe Reader and re-installed.  Any ideas on what could cause this?

    After much research of all options of security in programs I thought likely to affect Adobe Reader, I reached nothing a lot of expletives later, I found the solution

    Open Adobe Reader > edit > Preferences > search, click on "empty Cache Contents.

    Everything works again!

  • Key combinations give bad result?

    Hello

    I recently bought the HP Pavilion 15-e007tu from an ecomerce store. I just found out that when I press on "shift + 2" for typing ' @' he doesn't but double quotation ("") is a combination. "." In the same way when I press the combination 'shift + single quote', it seems "@" instead of double quotes.

    The keys work incorrectly, interchangeably, except these two the rest work correctly.

    How can I solve this problem? Is this a glitch or a large?

    Thanks for all your help!

    Yes, but the same thing applies to a laptop computer with Windows installed.

    Keyboards are mapped in languages and they may differ by a few keystrokes. A selection of English UK differs from English in the United States or International.

  • Satellite L10 and keyboard:-shift key gives wrong results

    Using the SHIFT key with most of other than a-z keys gives bad result.
    I tried to re - install a driver via Control Panel / keyboard with the Toshiba XP Home CD inserted but not better driver is found.
    Control Panel / regional and language setting is English UK

    Hello, Alan

    It will be nice if you can give us more information. What specific keyboard of the country you have? What you want to do exactly? Give us a few examples please.

  • ASCIISTR function that gives different results

    Hi Experts,

    I use the function ASCIISTR and it gives different results in SQLPLUS and TOAD

    SQLPLUS
    SQL> SELECT ASCIISTR('é') UC FROM DUAL
      2  ;
    
    UC
    -----
    \201A
    
    SQL> SELECT ASCIISTR('ú') UC FROM DUAL;
    
    UC
    -----
    \00A3
    TOAD
    SELECT ASCIISTR('ú') UC FROM DUAL
    
    \00FA
    
    SELECT ASCIISTR('é') UC FROM DUAL
    
    \00E9
    I know experts here will be reluctant to respond to questions about the TOAD, but I wanted to understand if I'm missing something. I checked the NLS_SESSION_PARAMETERS in SQLPLUS and TOAD, and they are the same. :-(does not understand this behavior

    Version of database Oracle Database * 10g Enterprise Edition Release 10.2.0.3.0 - 64 bit Production *.

    Thanks in advance!

    The default code for the command line page is 437, identical to TOAD, you want to get the code page 1252

    SQL> host chcp
    Active code page: 437
    
    SQL> SELECT ASCIISTR('é') UC FROM DUAL;
    
    UC
    _____
    \201A
    
    SQL> host chcp 1252
    Active code page: 1252
    
    SQL> SELECT ASCIISTR('é') UC FROM DUAL;
    
    UC
    _____
    \00E9
    
    SQL>
    
  • bad results for the search for context on the empty element tags

    I use Oracle DBMS 11.1 and 11.2 and created an index on an XML column context (article group: PATH_SECTION_GROUP).
    When you enter a query like

    SELECT count (*) FROM my_table t WHERE contains (t.co_xml,'hasPath(/tag1/tag2)') > 0

    I get bad results if tag2 is an empty element tag (< tag2 / >) that appears somewhere in the
    XML instance, but is NOT directly under tag1.

    For example, the following XML instance is (but shouldn't!):

    < a >
    blah blah < tag3 > < tag1 > < / tag3 > < / tag1 >
    blah < tag4 > < tag2 / > < / tag4 >
    < /a >

    This seems to happen only for the empty element tags. Is this a known bug and does anyone know of a workaround?

    Thank you in advance for your help!
    Roman

    Like you, I've been looking in the wrong places, bug of thought, rather than documented behavior. Finally, I came across the following excerpt from the next section of the documentation on haspath in Oracle text reference.

    http://download.Oracle.com/docs/CD/B28359_01/text.111/b28304/cqoper.htm#i997393

    Limits

    Because of the way in which XML data section are saved, false match may appear with XML sections that are completely empty as follows:

    
    

    A query of HASPATH(A/B/E) or HASPATH(A/D/C) falsely corresponds to this document. This type of fake correspondent can be avoided by inserting some text between the empty tags.

  • new to 4.02, no grid or column names in the query results

    It is a bit strange, I have SQL Developer 4.02 just installed, and I don't see grid or column names in the query results.  Don't see anything useful in tools > Preferences, what don't get me?

    The worksheet gives you a couple of different ways to run a query...

    1. instruction execute sheet icon toolbar (large green arrow, or Ctrl + Enter).

    This produces a results tab of the query with the data displayed in a grid.

    2. worksheet icon toolbar Execute the Script (the small tip of the green arrow on lined paper, or F5).

    This produces a tab out of the Script with the data displayed on the printer.

    If execution of the statement to Execute the Script, using some SQL * most orders will remove the column headers:

    1. set the position

    2. set the pagesize 0 (or 1 or 2).

    Pagesize and linesize default is - 1.  By default, the spreadsheet is free for formatting output script as he wishes.  If you have not changed these settings in the spreadsheet, then see if you point to a startup script in Tools > Preferences > Database > name of the connection startup script file

    Kind regards

    Gary

    SQL DeveloperTeam

  • Add the Month function

    Hello
    I have fields of database (Advance_issue_date, Repay_start_date). I spent sysdate in Advance_issue_date and then I want to give my gap of a month of aleast Repay_start_date date for this purpose, I used add month in insert trigger function before the recording of these two dates have a month, or not of the gap, if not then inform the user other wise it enter the date, it adds a month function works well but only one problem with it am I want to delete.
    It is:
    If Advance_issue_date is 29/05/2009 then I enter the Repay_start_date date is 30/06/2009. (can give more value, this isn't problem)

    but I want dates like this:
    Advance_issue_date is repay_start_date 29/05/2009 to 29/06/2009.

    any help...

    Thanks in advance
    Kind regards

    You may even write select statement

    If: EMP_ADVANCE. ADV_ISSUE_DATE is not null then
    If: EMP_ADVANCE. REPAY_START_date< addmonths(:emp_advance.adv_issue_date,1)="">
    message ("can not enter date less than ' |") AddMonths(:EMP_ADVANCE.) ADV_ISSUE_DATE, 1));
    raise form_trigger_failure;
    end if;
    end if;

  • With variable presentation month() function

    Hi all

    How can I use the MONTH() function in column answers, with variable presentation? I need to get the date month.
    I tried MONTHS (' @{tmp_date}' as date) but it doesn't work I get the error message.

    Thank you

    Hello

    If you select a single date value... go invite... then...
    Just keep filter on is invited to date column criteria of special relationship...

    Now, in the criteria take the same date column and apply * months ( column date ) *.

    So this column has the value selected and taken months of that particular date...

    try it this way...

  • How do you count multiple columns of a field in a table

    How do you count multiple columns of a field in a table

    Select count (*)

    of user_tab_columns

    where table_name = 'YOUR_TABLE '.

  • BAD RESULTS WITH OUTER JOINS AND TABLES WITH A CHECK CONSTRAINT

    HII All,
    Could any such a me when we encounter this bug? Please help me with a simple example so that I can search for them in my PB.


    Bug:-8447623

    Bug / / Desc: BAD RESULTS WITH OUTER JOINS AND TABLES WITH a CHECK CONSTRAINT


    I ran the outer joins with check queries constraint 11G 11.1.0.7.0 and 10 g 2, but the result is the same. Need to know the scenario where I will face this bug of your experts and people who have already experienced this bug.


    Version: -.
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    Why do you not use the description of the bug test case in Metalink (we obviously can't post it here because it would violate the copyright of Metalink)? Your test case is not a candidate for the elimination of the join, so he did not have the bug.

    Have you really read the description of the bug in Metalink rather than just looking at the title of the bug? The bug itself is quite clear that a query plan that involves the elimination of the join is a necessary condition. The title of bug nothing will never tell the whole story.

    If you try to work through a few tens of thousands of bugs in 11.1.0.7, of which many are not published, trying to determine whether your application would be affected by the bug? Wouldn't be order of magnitude easier to upgrade the application to 11.1.0.7 in a test environment and test the application to see what, if anything, breaks? Understand that the vast majority of the problems that people experience during an upgrade are not the result of bugs - they are the result of changes in behaviour documented as changes in query plans. And among those who encounter bugs, a relatively large fraction of the new variety. Even if you have completed the Herculean task of verifying each bug on your code base, which would not significantly easier upgrade. In addition, at the time wherever you actually performed this analysis, Oracle reportedly released 3 or 4 new versions.

    And at this stage would be unwise to consider an upgrade to 11.2?

    Justin

  • Query to find columns (in relation FK) which gives bad child result...

    I need to find all the columns in a Parent child table. I wrote the below query to do this.

    CREATE TABLE test_parent
    (      supplier_id      number(10)      not null,
         supplier_name      varchar2(50)      not null,
         contact_name      varchar2(50),      
         CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)
    );
    
    
    
    
    CREATE TABLE test_child
    (      product_id      number(10)      not null,
         child_supplier_id      number(10)      not null, ---*its child_supplier_id not supplier_id*
         CONSTRAINT fk_supplier
           FOREIGN KEY (child_supplier_id)
          REFERENCES test_parent(supplier_id)
          ON DELETE CASCADE
    );
    
    
    insert into test_parent values (3,'ABC','John');
    insert into test_child values (993983,3);
    
    
    COL TABLE_NAME FORMAT A25
    COL CONSTRAINT_TYPE FORMAT A25
    COL CHILD_COLUMN FORMAT A25
    
    select     a.table_name, 
         b.column_name child_column
    from user_constraints a,
         user_cons_columns b
         where a.r_constraint_name=b.constraint_name
    and R_CONSTRAINT_NAME =  (select constraint_name from 
                     user_constraints where table_name = 'TEST_PARENT' -- I enter the parent table name here
                    and constraint_type = 'P'
                   )
    and constraint_type = 'R';
    
    
    TABLE_NAME                CHILD_COLUMN
    ------------------------- ------------------------
    TEST_CHILD                SUPPLIER_ID
    It should be
    *child_supplier_id*
    Let's not my request. I'm doing something really stupid here.

    Try this one

    select fk_cons.table_name, fk_cons.constraint_name, fk_cols.column_name
    from user_constraints PK_cons
    join user_constraints fk_cons on fk_cons.r_constraint_name = pk_cons.constraint_name
    join user_cons_columns fk_cols on fk_cols.constraint_name = fk_cons.constraint_name
    where fk_cons.constraint_type = 'R'
    and PK_cons.table_name = 'TEST_PARENT';
    

Maybe you are looking for

  • Satellite M30x-165 - drivers for graphics card

    Hello I don't know if I post my thread in the correct language, but the interface of the site Web tells me it must be in English. However, I am of the Germany and I'm looking for drivers for the specifications mentioned in the title. I've already loo

  • Impossible to update the BIOS on Equium L350

    I tried updating the BIOS on my laptop but when I run the update I get the message "the ROM file is not newer than the BIOS. I've updated all the others drivers drivers optical drive, when I run the update to do this I get the messagae that they are

  • Driver Chipset

    I'm looking for the chipset driver for my compaq presario cq50-110us laptop? I did a clean install of windows 7 Professional and some drivers are missing and I think that the chipset is necessary...

  • This subtemplate of Pavilion DM3 do I?

    I need graphics driver for my dm3 (that I can't dim the screen under Ubuntu 11.10 dreamlike), but I don't know if my dm3 is a 1001, 1002, etc.. The thumbnail gives no useful information, or don't 'sudo dmidecode t - Systems. I can't use the auditor o

  • during the restoration of the system error message

    Pavilion dv6.3120us Windows 7-32 bit Cannot restore the system of rescue disks (5).  Receive the error code "oxeoefooe". "recovery manager cannot restore your computer by using the original image.  "Please contact HP support error code: oxeoefooe. Re