Newbie help on COUNT functions

Hi,
I am new to Siebel/Answers, and I need to learn something about the COUNT funtions. I have a table of 102 numerical entries, where only one entry is 0.
These are the results from the different COUNT functions
COUNT(expr) = 129
COUNT(*) = 129
COUNT (DISTINCT expr) = 102
The COUNT(expr) function is supposed to count all rows containing a non-null value, and the COUNT(*) is supposed to count all rows. What have I misunderstood about this? It seems wrong to me...
BR
Bjanger

"0" is not "null."

Similar Messages

  • Help with Count function

    Post Author: RJPiekos
    CA Forum: Desktop Intelligence Reporting
    I am trying to use the count function to count the number of unique PO numbers in a column. The program returns a value of "1" even when there are no PO's to be counted. Is there some system setting that i am missing.
    The universe that i am using is a free-hand SQL query to to an MS Access .mdb file. (if that makes a difference)
    Desktop IntelligenceBO 11.5
    Rick

    Post Author: RJPiekos
    CA Forum: Desktop Intelligence Reporting
    Found my problem - 'empty' values in the PO column were not NULL.

  • Need help for Count function in XSLT Mapping

    Hi All,
    We have a requirement in our project,to do the xslt mapping from OAGIS 9.0 to EDI XML.In the EDI XML we have a SE tag whose value is the count of the no. of complex elements that will be generated in the EDIXML file( which is the target).
    Please do let me know if anybody has done this functionality in the xslt mapping.
    Thanks in Advance.
    Regards,
    Kaavya

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • SOS, Urgent help for Count function

    Hi I need to count to different value on a same column
    SELECT DISTINCT A.job, COUNT(*),
    FROM STDNT_EMPLOYEE A, DATA B,
    WHERE A.EMPLID = B.EMPLID
    AND A.CAREER = B.CAREER
    AND A.YEAR = '2008'
    AND D.SEX = 'M'
    and D.SEX = 'F'// This is the line on question
         GROUP BY A.JOB
    output should be
    JOB     Male Female
    receptionist 10 20
    mechanic 4 0
    bookkeeper 3 6
    Any suggestions?
    Thank you

    missed out the group by function, incase
    SELECT DISTINCT A.job, sum(decode(d.sex,'M',1,0)) male,sum(decode(d.sex,'F',1,0)) female
    FROM STDNT_EMPLOYEE A, DATA B,
    WHERE A.EMPLID = B.EMPLID
    AND A.CAREER = B.CAREER
    AND A.YEAR = '2008'
    group by a.job,d.sex

  • Newbie Help: Calling Java function from XSLT

    Hi everyone!
    I am trying to call a java function from my XSL file. like...
    <xsl:stylesheet version="1.0"
        xmlns:java="http://xml.apache.org/xslt/java"
        xmlns:fn="http://www.my.com/xslt"     
        exclude-result-prefixes="java fn">
    <xsl:variable name="embeddedpic"
    select="formData/instance/EmployeePicture" />
    <xsl:variable name="pic" select="fn:com.my.utils.ConversionUtils.base64DecodeString($embeddedpic)"/>I am getting this exception in calling the above java function from my XSLT (XalanXPathException: The function number 'http://xml.apache.org/xslt/java:com.my.utils.ConversionUtils.base64DecodeString' is not available.)I have the function lib file in my classpath but still i am getting this error. Any info is highly appreciated.
    Thanks

    Try this.
    <?xml version="1.0" ?>
    <xsl:transform version="1.0" xmlns:fn="com.my.utils" >
    <xsl:variable name="pic" select="fn:ConversionUtils.base64DecodeString($embeddedpic)"/>
    etc.
    as long as your code is in the classpath it should find it.
    Henock.

  • URGENT_ Count function

    SOS, Urgent help for Count function
    Posted: Jan 30, 2008 8:47 AM Reply
    Hi I need to count to different value on a same column
    SELECT DISTINCT A.job, COUNT(*),
    FROM STDNT_EMPLOYEE A, DATA B,
    WHERE A.EMPLID = B.EMPLID
    AND A.CAREER = B.CAREER
    AND A.YEAR = '2008'
    AND D.SEX = 'M'
    and D.SEX = 'F'// This is the line on question
    GROUP BY A.JOB
    output should be
    JOB Male Female
    receptionist 10 20
    mechanic 4 0
    bookkeeper 3 6
    Any suggestions?
    Thank you

    Okay, I am new to this forum.
    output should be :
    JOB Male Female
    receptionist 10 20
    mechanic 4 0
    bookkeeper 3 6
    The value on the same column(Gender) is M and F I
    tried what other folks has posted it gives me the
    total value for both, I need them seperately on
    different columnyou just posted exactly what was in your original post.
    to help you we need some of the data in the original table.. not how you want it to look. unless you want someone to post:
    with t as (select 'receptionist' as job', 10 as male, 20 as female from dual
                union all select 'mechanic', 4, 0 from dual
                union all select 'bookkeeper', 3, 6 from dual)
    select * from t

  • Simple Count Function Help

    I have a really basic question. The following SQL query works for me:
    Select  EnterUserID, Enterdate
    from tblCsEventReminders
    where EnterDate >= Convert(datetime, '2015-04-01')
    I am essentially trying to write a query to count the number of user logins after a certain date, so I need to count 'EnterUserID' but I am having problems getting the count() function to work.  Any help is appreciated.
    Kurt 
    Kurt

    Hello Can you try something like this below:
    Select  COUNT(EnterUserID) AS UserLoginCounts
    from tblCsEventReminders
    where EnterDate >= Convert(datetime, '2015-04-01')
    Good Luck! Please Mark This As Answer if it solved your issue. Please Vote This As Helpful if it helps to solve your issue

  • Counter function value to multiple elements as same value in different node

    I need your help!
    I have a counter function and value of that needs to be passed to two elements of Node A and Sub Node B..
    Ex: Mapping
    Map Counter function to NodeA.Element1 and also to NodeB(subnode).Element2
    Expected Result:
    NodA.Element1 = 1
    NodeB.Element2 =1
    but I am getting the result as
    NodA.Element1 = 1
    NodeB.Element2 =2
    I understand the reason.. since the counter function is called each time..
    so my questions is how do I the expected result as mentioned--
    NodA.Element1 = 1
    NodeB.Element2 =1
    remember the XML is multiple occurence(1.. unbounded for both the nodes)
    Thanks-Gopal

    I think  I did not explain phrase it correctly..Technicallyh NodeA.Element1 value should be copied to NodeB.Element2..As long as I can generate counter to NodeA.Element1 and hold the value somewhere to copy to NodeB.Element2, that would be fine..
    the above suggestion you guys made would not work as it will create two different set of sequences.. however Index suggestion might work differently but still I might go out of sequence if I have multiple detail record for each master record..
    Here the expected output (concise)
    Record 1 - NodeA.Element1 = 1
    Record 2 -NodeB.Element2=1
    Record3- NodeA.Element1 =2
    Record4 - NodeB.Element2=2  -->two detail records
    Record5 - NodeB.Element2=2  --> two detail records
    please help

  • Count() function throws error in EQL query for metric

    Hi
    I am trying to use count function in EQL query for Metric Bar to show the number of occurrences of a record.
    When the record type doesn't exist i expect the function to return count as 0. Instead the function throws a runtime exception and the whole Metric Bar portlet fails, with error No Results Available. Even though other components in the metric bar have valid results.
    2013-02-21 13:03:51,216 WARN [MetricsBarQueryProcessor] The EQL query does not return any results.
    2013-02-21 13:03:51,216 ERROR [MetricsBarQueryProcessor] The EQL query does not return any results.
    2013-02-21 13:03:51,216 WARN [MetricsBarResultsProcessor] No statement results to process.
    The EQL query i am using is
    RETURN NUMBER_OCCURS AS SELECT COUNT(EMP_ID) AS NUMBER_OCCURS where EMP_NAME IS NOT NULL group;
    I tried using COALESCE but that doesn't help.
    Can some one please suggest a workaround to this?

    Srikanth,
    Two statements are used here because the original question was pertaining to the null set (where there are employees in the nav state but no employees that fit the special analytics criteria in the navigation state). The question/answer has nothing to do with what is in the COUNT parentheses clause as Counting a null set will always give you NULL, not 0, no matter what you put in there.
    What we're really doing, in the second part of the query, is writing a query over a set of data that is not the null set (i.e. the current navigation state). This allows the 0 value to come through in the case where the first analytics statement is evaluated over a null set of records. If there were truly no records in the navigation state, this too would return a null set and not zero.
    Hope that makes sense, feel free to respond (either on here or offline) if it's unclear.
    Regards,
    Patrick Rafferty
    http://branchbird.com

  • Distinct Count Function-how to use properly

    Hello,
    I am new to using forums & have only been using Crystal since May of 2009, so i hope i do this correctly & provide the appropriate information.  i've looked for this answer in what's been posted but cannot find it.  Some things i've read I don't really understand.  I only know how to use the functions that are in the software, i don't know how to write them myself (i think that's when people have referred to SQL code or basic syntax)
    I have CR Professional, version 11.0.0.1282 (Crystal Reports XI).
    I work at a county health dept and we have a annual medicaid cost report,  I am linking Crystal to our EMR billing module.  i have my report sorted by insurance, ie medicaid, bcbs, abw, hpm etc.  and within each ins group i have the clients ID, DOS (date of service), procedure code, charge amt, ins pmt & patient pmt.  i have totaled the charges & pmts for each group-works fine.  i even have been able to create the formula to adj out the duplicate entries in the billing module (a service was entered wrong then adjusted out then re-entered correctly-without my formula crystal was pulling both these records and adding them to total charges.)
    Where my problem lies and what my question is:  I need to count encounters, an encounter is the visit, but each visit could have 2 or more procedure codes.   So this results in multiple lines on my report for one visit, which i want for the charges to add correctly, but it makes my visit count to high. So I read about the distinct count function, of which there are three listed & i'm having a hard time understanding the differences.  What i tried is: a distinct count of the acct ID-so the same acct ID's are only counted the one time.  But some clients see us more than once per year, meaning the acct ID is the same but the DOS is different.  For this client that would be 2 visits.  But crystal is counting this as 1.
    Saying what i want to do is this:  Count as 1 when the acct ID and DOS are the same.  I've tried using the different distinct counts but when i check my formula it always has errors.  So I'm sure my lack of knowledge is what's holding me up-i fully believe crystal can do this.
    Any help would be greatly appreciated.

    I create a dummy table, set up acc_id and DOS and Charge.
    Created a running total
    Summarized acc_id
    Type of summary Count
    Evaluated using a formula
         <> previous ()
    and reset on ACC_ID
    My groups were sorted by acc_id and date
    where there were multiple visits on the same DOS my count was 0
    where the dos changed it would count accordingly.
    You may need to use two Running totals to get the complete picture.

  • Why is the Tick Count function slow when used with a .dll but fine with normal lab view code?

    when using the Tick Count millisecond timer with a .dll I've written in C, I'm getting some odd timing issues.
    When I code the function I want (I'll explain it below in case it helps) in LV and run it as a subVI, feeding it the Tick count as an argument, the function runs quickly, but not quite as quickly as I would like. When I feed this same subVI just an integer constant rather than the Tick Count, it takes about the same amount of time, maybe a tiny bit more on average.
    When I bring in my function from a .dll, however, I start to run into problems. When I feed my function an integer constant, it is much faster than my subVI written in LV. When I feel my .dll the Tick Count, however, it slows down tremendously. I'm including a table with the times below:
                 |  Clock   |   Constant   |
    SubVi:   | 450ms  |  465ms       |
    .dll         | 4900ms|  75ms         |
    This is running the function 100,000 times. The function basically shifts the contents of a 2-dimensional array one place. For this function, it probably won't be a huge deal for me, but I plan on moving some of my other code out of LV and into C to speed it up, so I'd really like to figure this out.
    Thanks,
    Aaron

    Hi Aaron,
    Thanks for posting the code -- that made things a lot clearer for me. I believe I know what's going on here, and the good news is that it's easy to correct! (You shouldn't apologize for this though, as even an experienced LabVIEW programmer could run into a similar situation.) Let me explain...
    When you set your Call Library Function Node to run in the UI Thread you're telling LabVIEW that your DLL is not Thread-safe -- this means that under no circumstances should the DLL be called from more than one place at a time. Since LabVIEW itself is inherently multithreaded the way to work with a "thread-unsafe" DLL is to run it in a dedicated thread -- in this case, the UI thread. This safety comes at a price, however, as your program will have to constantly thread-swap to call the DLL and then execute block diagram code. This thread-swapping can come with a performance hit, which is what you're seeing in your application.
    The reason your "MSTick fine behavior.vi" works is that it isn't swapping threads with each iteration of the for loop -- same with the "MSTick bad behavior.vi" without the Tick Count function. When you introduce the Tick Count Function in the for loop, LabVIEW now has to swap threads every single iteration -- this is where your performance issues originate. In fact, you could reproduce the same behavior with any function (not just TIck Count) or any DLL. You could even make your "MSTick fine behavior.vi" misbehave by placing a control property node in the for loop. (Property nodes are also executed in the UI thread).
    So what's the solution? If your DLL is thread-safe, configure the call library function node to be "reentrant." You should see a pretty drastic reduction in the amount of time it takes your code to execute. In general, you can tell if your DLL is thread-safe when:
    The code is thread safe when it does not store any global data, such as global variables, files on disk, and so on.
    The code is thread safe when it does not access any hardware. In other words, the code does not contain register-level programming.
    The code is thread safe when it does not make any calls to any functions, shared libraries, or drivers that are not thread safe.
    The code is thread safe when it uses semaphores or mutexes to protect access to global resources.
    The code is thread safe when it is called by only one non-reentrant VI.
    There are also a few documents on the website that you may want to take a look at, if you want some more details on this:
    Configuring the Call Library Function Node
    An Overview of Accessing DLLs or Shared Libraries from LabVIEW
    VI Execution Speed
    I hope this helps clear-up some confusion -- best of luck with your application!
    Charlie S.
    Visit ni.com/gettingstarted for step-by-step help in setting up your system

  • Error: DAQ-STC Counter functions missing from library

    Using LabView 6.1, NI-DAQ 6.6.1 for MacOS on a laptop.
    DAQ Hardware: DAQCard 16E-4.
    When trying to use the advanced counter functions (for DAQ-STC type counters), LabVIEW generates an error saying that it can't find the function in the library. The code interface nodes for the VIs don't seem to be attached to anything. I've installed the latest version of DAQ Drivers for Mac; am I missing something here? Any insight into this problem would be appreciated.
    Regards,
    jdk

    Hi jdk,
    I think it could be just an installation issue. I assume that you are using Mac 9.1. I've run LV 6.1 with NIDAQ 6.6.1 on Mac 9.1 and it works just fine, including DAQ-STC counter functions.
    If LabVIEW 6.1 was installed without DAQ support, run the LabVIEW 6.1 installer and perform a custom installation for DAQ support. Then, run
    the NI-DAQ 6.6.1 installer to upgrade NI-DAQ.
    Hope this helps.
    Regards,
    Pravin Borade
    Applications Engineer, National Instruments

  • Count( ) function in BIP Report

    Hello,
    Can someone please help me with my count( ) function in BIP reports? I have this code in my RTF template below that only count 1 per ssImageType
    <?xdofx:if (ssStatus='Closed') and (ssGroup='EDS OPS') then count((/ssAction=/ssImageType))?><?end-if?>
    The undesired result is coming up below:
    Image Type A = 1
    Image Type A = 1
    Image Type A = 1
    Image Type B = 1
    Where we wanted it to come up as
    Image Type A = 3
    Image Type B = 1
    Image Type C = 0
    Any help would be greatly appreciated.
    Thank you

    What is the item that you want to count? I don't understand what you are trying to do here: count((/ssAction=/ssImageType))?
    If status is closed and ssGroup = EDS OPS, and ssAction = ssImageType, then you want to count the number of records?
    If you want to, send me the rtf and xml file to [email protected] and I can take a look. Send me the exact specification..
    Thanks,
    Bipuser

  • Count function on months column gives wrong result

    Hi,
    I am on OBIEE 11.1.1.7.150120.
    I used the count function on the month column and rather than getting 12 as the answer i get 365. (i used a filter on the year column to restrict it to one year)
    How could this happen?
    Any help would be appreciated.

    I was able to get the answer as 12 on the month column in the Dim_Time using the count distinct.
    The main reason i was trying this is because i have a VALUE column in VIew_A. I am trying to sum the values of these, but when i use the sum function, the output is quite huge and wrong. I dosen't match with the monthly figures.
    For eg:
    Month
    Income Cost
    JAN
    186.96
    FEB
    309.29
    MAR
    246.82
    APR
    247.95
    998.76
    1,462.74
    MAY
    160.27
    645.60
    1,643.84
    JUN
    172.19
    693.61
    927.12
    JUL
    150.27
    605.32
    855.89
    AUG
    133.61
    483.66
    538.20
    789.22
    SEP
    144.56
    412.42
    582.34
    824.84
    OCT
    264.96
    315.66
    364.00
    631.32
    1,067.32
    1,466.22
    NOV
    240.39
    832.10
    968.32
    1,058.73
    1,638.38
    DEC
    215.81
    857.30
    869.31
    24005.34
    But if i use the sum function on the Income/cost column, the value i get is
    C_MONTH
    SUM(INCOME_COST)
    JAN
    5,795.86
    FEB
    8,660.21
    MAR
    7,651.52
    APR
    81,283.62
    MAY
    75,941.13
    JUN
    53,787.67
    JUL
    49,955.96
    AUG
    60,285.39
    SEP
    58,924.80
    OCT
    127,394.01
    NOV
    142,137.76
    DEC
    60,215.18
    This just doesn't work out. I need the answer to be 24005 by using the sum function

  • Count Function on Date Field in Discoverer

    Hey folks,
    How would someone like to educate a novice on how to perform a count function on a date field? I am writing a Discoverer report and have a requirement to display counts of the number of records that have a modified date of > 30 days and > 60 days. I am trying to use the 2nd count function as such: COUNT(modified_date < (SYSDATE - 30)). I keep getting the "error in function" message. I have tried it with CURRENT_DATE as well and get the same error.
    Any help would be greatly appreciated.
    Thanks much,
    Schuyler

    Hi
    You can't use logical expression in a function like this:
    COUNT(modified_date < (SYSDATE - 30))
    instead of this use CASE expression:
    COUNT(case when modified_date < (SYSDATE - 30) then 1 else 0 end)
    Ott Karesz
    http://www.trendo-kft.hu

Maybe you are looking for

  • Error while installing ECL viewer 6.0

    Dear Gurus, I tried installing the ECL viewer 6.0 with followin steps... 1. un installed the previous version by deselecting the viewer in "general add-ons" of the gui setup. 2. Checked for the Webviewer2d.dll..... no trace 3. installed the ECL Viewe

  • Question about backing up MBP

    I purchased my MBP back in August of 2009 and it has been virtually flawless since I have bought it. However I have downloaded all kinds of stuff to it and added all kinds of different things to it, I have a pretty large music library and what I woul

  • Do I need to reinstall apps if I had them on previous subscription? [was:apps]

    Do I need to reinstall apps if I had them on previous subscription?

  • How to make color tone like this?

    I'd like to find out how to make similar "color tone" effect like this: http://www.horror-movies.ca/watermark.php?filename=poster_THE_SITTER_2D_ORING.jpg I'm talking about those striking "artificial" skin tones you can see on many movie posters (or a

  • Strange volume swells in DLSMusicDevice, general midi playback, since Lion upgrade

    Hi all, Like many people, I upgraded to Lion when it first came out, and overall, everything's been working great. I'm a composer though, so I make frequent use of Sibelius. My problem isn't specific to Sibelius, so don't worry if you don't have expe