function count() throws the error in the EQL query for metric

Hello

I try to use count function in query EQL for metric bar to display the number of occurrences of a record.
When the record type does not exist, I hope that the function returns the number 0. Instead the lift function a runtime exception and the whole Bar Metric portlet fails, error no. results available. Even if the other components of the metric bar have valid results.

2013-02-21 13:03:51, 216 WARN [MetricsBarQueryProcessor] EQL the query returns no results.
2013-02-21 13:03:51, 216 ERROR [MetricsBarQueryProcessor] EQL the query returns no results.
2013-02-21 13:03:51, 216 WARN [MetricsBarResultsProcessor] no declaration is the result of process.

The EQL query I use is
BACK NUMBER_OCCURS AS SELECT COUNT (EMP_ID) AS NUMBER_OCCURS where EMP_NAME IS NOT NULL group;

I tried to use COALESCE, but it does not help.

Can someone please suggest a work around?

Varkashy,

It should work...

DEFINE foo AS SELECT COUNT (1) AS NUMBER_OCCURS where EMP_NAME IS NOT NULL group;

RETURN NUMBER_OCCURS AS SELECT
COALESCE (foo []. NUMBER_OCCURS, 0) AS NUMBER_OCCURS
GROUP

Patrick Rafferty
http://branchbird.com

Edited by: Branchbird - Pat on February 21, 2013 05:20

Tags: Business Intelligence

Similar Questions

  • Count (*) with the nested query

    Hello
    I have a question about the count (*) with the nested query.

    I have a table T1 with these columns:
    Number of C1
    Number of C2
    Number of C3
    Number of C4
    Number of C5

    (The type of each column is not relevant for example).

    This query:
    Select C1, C2, C3, C4
    from T1
    Group C1, C2

    It is not correct becausa C3 and C4 are the columns specified in the GROUP BY expression.

    If you run this query:
    Select count (*)
    (select C1, C2, C3, C4
    from T1
    Group C1, C2)

    I don't have an error message (properly, the result is the number of records).

    Why?

    Thank you.

    Best regards
    Luca

    because the optimizer rewrites as

    SELECT     COUNT(*)
                  FROM   T1
              GROUP BY   C1, C2  
    

    G.

    Edited by: g. March 1, 2011 09:19

  • Worn and counting on the same query?

    I have a table with the following fields: groupname, FULL_NAME, DEFAULT_X, SUPPORT_GROUP_ID and PERSON_ID (among others)
    A user (PERSON_ID) can be different times, they appear once for each group (SUPPORT_GROUP_ID) that they are assigned to.
    When the DEFAULT_X == 0, this means that the user's default group is on this line. Each user should have only one only by default the group, but for some reason, the table was corrupted and there are a few users that don't have a default group.
    What I'm trying to do is to select all the users (FULL_NAME, PERSON_ID) where the PERSON_ID COUNTY is equal to the SUM of DEFAULT_X
    It sounds easy enough, but I don't even know where to start.
    Any suggestions?

    Hello

    So you say
    default_x = 0 if this is the default group, and
    default_x = 1 in all other cases
    Is this fair?

    If so, you can say:

    SELECT    person_id
    FROM      table_x
    GROUP BY  person_id
    HAVING    COUNT (*) = SUM (default_x);
    

    HAVING is similar to WHERE, except that HAVING is applied after the merger took place and functions of aggregation (like SUM and COUNT) were calculated.

    However, your problem is that default_x is not entered correctly. If default_x is sometimes 1 to 0, are not concerned it may contain other errors, like having 2 or - 1, whereas she would have to have 1?

    Here's a better way to find person_id who don't exactly have a single line with default_x = 0:

    SELECT    person_id
    FROM      table_x
    GROUP BY  person_id
    HAVING    SUM
              (
                  CASE
                      WHEN  default_x = 0
                      THEN  1
                      ELSE  0
                  END
              ) != 1;
    
  • What can be the SQL query for this requirement?

    Hello
    I have a table with the fields like this:

    ID DESC PARENT
    01 02 ABC
    02 01 ABC1
    03 01 ABC2
    04 02 ABC4


    In the table above column PARENT refers to the column ID, but actually in the SQL query, I want to have ID DESC and PARENTDESC (i.e., desc ID value corresponding)

    Output real I need is

    SELECT ID, DESC? from table where ID = someValue. Now, if I provided ID = 01 then output should be like this:

    ID DESC PARDESC
    ABC1 ABC 01


    Can anyone help on what may be the required sql query?

    Published by: bootstrap on April 29, 2011 06:15

    SELECT T1.ID, T1. DESC, T2. / / DESC
    FROM TABLEA T1, T2 TABLEA
    WHERE T1.ID = '01'
    AND T2.ID = T1. PARENT;

  • * How to display the group from the main query for the first time in the report?

    Hello

    I have developed a group of master / detail in a report
    The master has its extensible framework and the detail of one another framework extensible and put to another page in the page layout.
    The problem is that the master one appears (the same record) in the pages in time equal the number of records in detail that is specific for this master record!
    Example:
    If the master record got three Details then database will show three times (three pages) and then running page number 4 will display the three detail records.

    How to make the master data in shown only for once (page number 1 only) and then display the details three records to the next page (page number2) at run time?

    Hello

    the question is, what you've done for this. By default the primary record is displayed only once. Could it be, that the master-fields are inside the extendable frame for more details?

    Concerning
    Rainer

  • The View object: count (*) in the custom query

    Hello

    I want to create a display with custom query object containing the count (*):

    select in_owner,in_processing_status,count(*) from inquiries group by in_owner,in_processing_status;
    

    I need this to create a numerical value for the axis y in the bar chart.

    I get an error message:

    "Either this is not a valid name or an object with that name already exists."
    

    Is there no workaround available, how do I get this to work, or I have to do with a data source by programming?

    Studio Edition Version 12.1.3.0.0

    Thank you and best regards,

    Daniel

    I solved the problem by adding alias for count (*):

    SELECT count from in_owner, in_processing_status, count (*) Group of inquiries by in_owner, in_processing_status;

    Thank you all for the support!

    BR,

    Daniel

  • Counting of the icons just for Fun

    Just to bump Ghislain, how can we know how many icons are in a lesson? Y at - it an a function already established or variable within the AW 7.02? I know that a library gives you the number of how many items is in the ".a7l", but I was wondering if there was something similar to a ".a7p".

    TIA,
    Jerry

    Jerry,

    -Select the root timeline
    ---Select modify > file > properties from the menu

    Kind regards

    Andrew

  • How to use an internal counter of the cDAQ-9172 for measure PWM and generate the frequency?

    Hello

    Requirement of my project is to measure 6-channel PWM and generate 5 frequency channels.

    Suggestion of engineer OR bought cDAQ-9172 chassis and NI 9423 (8 DI correlated) and NI 9474 (8 correlated DO) for this requirement. I have a few questions

    Article:

    1 > what should I know to customize my CompactDaq 9172 chassis

    http://zone.NI.com/DevZone/CDA/tut/p/ID/9367

    I know that this way to synchronize the physical support 32 correlation system pin o for housing 1-4.

    => I'm not really sure how to use these channels synchronization support.

    2 > using internal counters on one NOR cDAQ-9172 as a sample for other tasks clock

    http://digital.NI.com/public.nsf/allkb/ADFC4DD8C9690232862575B70079FBD4

    I know that I can change the ownership of the physical channel so I can get 2 meter outside the frame 6 and 7.

    => I do not think that this solution will be me because I can use only 2 counters with this method.

    Could someone tell me please how to fix my project requirement? How to choose the setting for DAQmx screws?

    I have experience with measure the PWM and generate the frequency, but with separated against only.

    Best regards

    Thang Nguyen

    Hey Thang.

    AHA... for this, you can use the channel property node.

    See you soon

    Lab

  • How can I have a staff and a company that counts on the same computer for e-mail

    I have a personal email address on my computer. I want to be able to receive and send emails with my business on my computer as e-mail address.

    Can you tell me how to do this? Personal e-mail is * address email is removed from the privacy * and business email is tmcmahon @kellermechanical.com.

    To post a link see 2 toghether email in hotmail: http://explore.live.com/windows-live-hotmail-email-accounts-aggregation-using

  • How to write the select query for it

    Hello

    I had an html form and the area I drop down and he needs to select several values in the drop-down box. When I select multiple values then I have to write the query to SQL select statement.

    When I try to write the select statement and trying to run I get the error message.

    Select * from Table

    where emo_no = '1,2,3 '.

    That's how I write the query please suggest me how to write the query to select several values in the drop-down box.

    Thank you

    Use the keyword sql 'in '.  If you don't know how, I've heard good things about the book Teach Yourself SQL in 10 Minutes by Ben Forta.

  • How to make the simple query for this scenario... ?

    Hello:

    Dummy table provided for simplicity.

    It's my database table (Table_A)

    Date1 | Plane1 | Category | Duration | Fees
    01/01/2011 | A | Gold | 5. 2
    01/01/2011 | C | Money | 4. 11
    01/01/2011 | B | Gold | 6. 2
    01/01/2011 | D | Gold | 2. 4
    01/01/2011 | B | Gold | 3. 5
    01/01/2011 | A | Money | 4. 8
    01/01/2011 | B | Gold | 1. 3

    I need to write a query to get the result below:

    Date1 | Plane1 | Sum_Duration | Sum_Charge | Sum_Gold_Duration | Sum_Gold_Charge | Sum_Silver_Duration | Sum_Silver_Charge
    01/01/2011 | A | 9. 10. 5. 2. 4. 8
    01/01/2011 | B | 10. 10. 10. 10. 0 | 0
    01/01/2011 | C | 4. 11. 0 | 0 | 4. 11
    01/01/2011 | D | 2. 4. 2. 4. 0 | 0

    This query will provide the 1st four columns:

    SELECT Date1,
    base1,
    Sum (Duration) Sum_Duration,
    Sum (load) Sum_Charge
    FROM TABLE_A
    GROUP BY date1, rarateplan

    But I need to know how to get the rest of the columns (i.e. Summary according to categories; from 5 to 8 columns)? Is this can be done in a single query without writing subqueries?

    Please let me know, (with code), the best way.

    Thank you-
    Tanvir

    Use like this:

    SELECT Date1,
    base1,
    Sum (Duration) Sum_Duration,
    Sum (load) Sum_Charge,
    SUM (decode(Category,'Gold',duration,0)) Sum_Gold_Duration,
    SUM (decode(Category,'Gold',charge,0)) Sum_Gold_charge,
    SUM (decode(Category,'Silver',duration,0)) Sum_Silver_Duration,
    SUM (decode(Category,'Silver',charge,0)) Sum_Silver_charge
    FROM TABLE_A
    GROUP BY date1, rarateplan

    Published by: SANT007 on August 11, 2011 11:04

  • How can I write the SQL query for this requirement?

    Hello

    I have a table that looks like this:

    NAME | ANNUAL |     VALUE
    ==== | ====== | =====
    execno |     480.     000004
    step |      480.     0400
    SCNA |     480. cd_demo
    System |     480.     D47-010
    type |     480.     step
    free_text |     480.     stage 400
    rbare |     480.     RBA-1
    execno |     482. 000004
    SCNA |     482. cd_demo
    System |     482.     D47-010
    free_text |     482.     step 300
    step |          482.          0300
    type |      482.     step
    rbare |     482.     RBA-1
    execno |     483.     000001
    type |     483.     step
    rbare |     483.     rke1
    SCNA |     483.     rke10
    step |     483.     0240

    Now, say that I want to fetch ONLY annual with execno = '000004' and '400' = step and scna = "cd_demo" and system = "d47-010' and type = 'step', how to write SQL code?
    At first, it seemed like a simple writing query but I've been struggling with it for hours without success. I must admit though that I'm not strong in SQL :-)
    There, can anyone help? Please...

    Thanks in advance.

    Emmanuel

    Published by: user12138559 on October 30, 2009 03:05

    Hi, Emmanuel.

    Welcome to the forum!

    Here's a way to do what you asked:

    SELECT       doc_id
    FROM       table_x
    GROUP BY  doc_id
    HAVING       SUM (CASE WHEN name = 'execno' AND value = '000004'  THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'step'   AND value = '400'     THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'scna'   AND value = 'cd_demo' THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'system' AND value = 'd47-010' THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'type'   AND value = 'step'    THEN 1 END) > 0
    ;
    

    If you think that a WHERE clause would be used, but WHERE does apply to a single line. You need a condition that checks several rows in the same group.
    WHEN has an effect something like WHERE.

    Published by: Frank Kulash, October 30, 2009 06:26

    This solution assumes that (name, annual) is unique.

  • An error occurred when querying for the pending operations

    Original title: sysprep problem
    I have an acer aspire 5738Z, I use windows 7 (64 bit) I try to open sysprep.exe and it does not open, a text box appears saying "an error occurred when querying for the pending operations. What can I do to fix this?

    Hello

    Thanks for posting the request in the Microsoft community forums.
    I understand that you receive the error "an error has occurred when querying for outstanding operations" when trying to open sysprep.exe on the computer.

    You can try the solutions provide and check if it helps solve the issue.

    Method 1:
    You can scan System File Checker to fix corrupted files.
    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
    http://support.Microsoft.com/kb/929833

    Method 2:
    If the steps above fail then you can try the steps and check.

    a. run regedit by typing regedit in start search by pressing ENTER.
    b navigate to the following key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
    Key: RegistrySizeLimit
    Type: REG_DWORD
    Value: 0xffffff (4294967295)
    c. reset.

    If you need help with Windows, keep us informed. We will be happy to help you.

  • Throw the error on a popup message

    Hello

    12.1.3 Jdev

    I have to implement the change password functionality in one of my page. I created a link on my page saying 'Change Password '. When I click on this link a new window comes up with 2 password fields. When I click OK, it calls the method in the managed Bean. Everything works fine.

    But I wanted to throw, and the error message when the entered password will not match. How can I throw the error message in the popup window without closing the popup.

    I tried the codes, but what's going on here is the original popup is closed and a new popup comes up with the error message.

    JboException ex = new JboException("Passwords are different. !!!!!"); 
               BindingContext bctx = BindingContext.getCurrent();
               ((DCBindingContainer)bctx.getCurrentBindingsEntry()).reportException(ex);
    

            FacesContext context = FacesContext.getCurrentInstance();
            FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, "Password are different.", "");
            context.addMessage(null, facesMessage);
    

    I wanted are the popup Window with the password window should remain, an error message to show. (in another pop-up window or on the same pop-up window.)

    Popup window code:

      <af:popup childCreation="deferred" autoCancel="disabled" id="popupPwd">
                                                <af:dialog id="d2" title="Change Password"
                                                           dialogListener="#{pageFlowScope.profileBean.changePassword}">
                                                    <f:facet name="buttonBar"/>
                                                    <af:panelFormLayout id="pfl4">
                                                        <f:facet name="footer"/>
                                                        <af:inputText label="New Password" id="it2" secret="true"
                                                                      value="#{pageFlowScope.profileBean.newPassword}"/>
                                                        <af:inputText label="Re-enter New Password" id="it12"
                                                                      secret="true"
                                                                      value="#{pageFlowScope.profileBean.newPassword1}"/>
                                                    </af:panelFormLayout>
                                                </af:dialog>
                                            </af:popup>
    

    See you soon

    AJ

    Check this blog Blog of the ADF (Application Development Framework) that shows how to do this.

    Timo

  • OAException.ERROR is not throwing the error

    Hi friends,

    I am faced with a particular problem. I extended the oracle.apps.per.selfservice.specialinformation.webui.SitNavigationBarCO CO.

    When the user clicks the next button, I perform a function and the return value and based on the return value that I throw the error. I am unable to call the function, and then, the function also returns a correct value. However I do not see the error message be lifted. I assume using OAException.ERROR the error pops up in the upper part and the user will not be able to navigate to the next page. Also, I enabled the logging and the function returns the value 'B '.

    Here's the code. Any ideas what I am doing wrong help. Apps version is 12.1.3

    Thank you

    ' Public Sub processFormRequest (OAPageContext oapagecontext, OAWebBean oawebbean)

    {

    super.processRequest (oapagecontext, oawebbean);

    If (oapagecontext. GetParameter ("HrNext")! = null) {}

    OAApplicationModule oaapplicationmodule = (oawebbean) oapagecontext.getApplicationModule;

    OADBTransaction oadbTrans = oaapplicationmodule.getTransaction ((OADBTransaction));

    String retValues = null;

    try {}

    userId int = oapagecontext.getUserId ();

    String idFlexNum = "50425;

    StringBuffer str = new StringBuffer();

    Str.Append ("BEGIN");

    Str.Append (": 1: = XX_CUSTOM_SIT.") VALIDATE_LOAN_REQUEST (»);

    Str.Append ("p_user_id = >: 2," "");

    Str.Append ("p_id_flex_num = >: 3" "");

    Str.Append (»); «) ;

    Str.Append ("END");

    OracleCallableStatement oraclecallablestatement = (OracleCallableStatement) oadbTrans.createCallableStatement (str.toString (), 1);

    oraclecallablestatement.setInt (2, userId);

    oraclecallablestatement.setInt (3, Integer.parseInt (idFlexNum));

    oraclecallablestatement.registerOutParameter (1, Types.VARCHAR);

    oraclecallablestatement. Execute();

    retValues = oraclecallablestatement.getString (1);

    oapagecontext.writeDiagnostics (this, "retValues:" + retValues, 2);

    } catch (Exception e) {}

    throw OAException.wrapperException (e);

    }

    If (retValues.equals ("A")) {}

    throw new OAException ("You are not eligible for loan based on your service", OAException.ERROR);

    }

    If (retValues.equals ('B')) {}

    throw new OAException ("You can't apply for loan more than 2 times", OAException.ERROR);

    }

    If (retValues.equals ("C")) {}

    throw new OAException ("Loan is false", OAException.ERROR);

    }

    }

    Dear all,

    This problem is solved after I put the following instructions.

    oapagecontext.putDialogMessage (new OAException (message, OAException.ERROR));

    oapagecontext.forwardImmediatelyToCurrentPage (null, true, null);

    I thank Rakesh for the solution. Is the thread that helped me

    https://forums.Oracle.com/message/3929589#392958

    Thank you

Maybe you are looking for

  • Satellite A300 - its different in PSAJ4E and PSAG8E

    I have two Toshiba Satellite A300. An A300 - 15K (PSAJ4E) and a driver Conexant instaled. Second is A300-20th (PSAG8E) and the driver of Realtek Semiconductor Corporation. The sound coming from harman/kardon in the first is beautiful and the second w

  • Skype freezes iphone 3gs

    So Ive had Skype on my iPhone for a few years now, everythings been working well updated share the occasional accident but now all of a sudden last week whenever I try to make a call, the application block my whole phone and I have to hard reset by p

  • Satellite U400-124: is it possible to restore the operating system without the DVD

    I have a U400-124 I want to do a system restore.I created the Toshiba Recovery DVD but I don't have it with me (I'm in Italy and it is in the United Kingdom). I have three left: 1 Vista (c :))2 WinRE (d :))3 data (e :)) Is it possible to restore the

  • Apple Watch back in the range

    I would like to know if the Apple Watch returns in the range with the iPhone, is pushed and shown on the watch notification?

  • My friends iPhone slow fees

    OK you have any clues? My friends iPhone recharges so slow and the cable connector keeps popping out. p.s. The accusations of the iPhone with a third-party usb and cable connector