SUM(expr) without COUNT(expr)

I have created one MV of type aggregation. when i used DBMS_MVIEW.EXPLAIN_MVIEW i found that "SUM(expr) without
COUNT(expr)".
I have used SUM(exp) function but i dont require count(exp) .
Now due to "SUM(expr) without COUNT(expr)" reason my mv does not gets fast refresh
after any DML on the base master table.
What to do do now?
Is there any alternative for that?
I mean i want to use sum(exp) but not count(exp) and also want fast refresh when any DML applied on base master table.

What your topic has to do with Community Feedback and Suggestions???
Speaking about your question - how about reading oracle documentation?
http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/basicmv.htm#i1007880
Excerpt:
For fast refresh to be possible, the SELECT list must contain all of the GROUP BY columns (if present), and there must be a COUNT(*) and a COUNT(column) on any aggregated columns.
So there isn't any alternative.
Gints Plivna
http://www.gplivna.eu

Similar Messages

  • [Materialized View]: SUM(expr) without COUNT(expr)

    I have created one MV of type aggregation. when i used DBMS_MVIEW.EXPLAIN_MVIEW i found that "SUM(expr) without
    COUNT(expr)".
    I have used SUM(exp) function but i dont require count(exp) .
    Now due to "SUM(expr) without COUNT(expr)" reason my mv does not gets fast refresh
    after any DML on the base master table.
    What to do do now?
    Is there any alternative for that?
    I mean i want to use sum(exp) but not count(exp) and also want fast refresh when any DML applied on base master table.

    You have to add count(expr) to your MV . This is a requirment for fast refresh MV.
    Rgds

  • Sum of Distinct Count

    Hi,
    In my query I have location, month, date and customer.
    I want to have a unique count of customers for each day. And then sum this unique count (at day level) for a month.
    This calculated measure needs to be placed in a cross tab having location and month.
    So For ex: If unique count for 1st is 10 and 2nd is 20 then for the month it should 30.
    Please advice me on how to structure formula,
    Thank you,
    CD

    I didn't understand what the problem is.
    If you are just trying to do a summation of your count, if that count is a measure in your report, then just select that measure in the cross tab, and hit summation - a column will be added at the end of the cross tab to your right.
    If this is not what your are looking for, please provide more details.
    Thanks.

  • Avg/sum/min/max/count

    Is there anyway to see the avg/sum/min/max/count when you highlight a bunch of cells? I can't figure out if iPad numbers has this function. I've read several articles that mention it.
    Also, I am having trouble with some formulas, does anyone know where I might get help on that?

    Download *_Numbers User Guide_* and *_iWork Formulas and Functions User Guide_*
    You may do that from the Help menu of the version running on a mac.
    You may also download them thru :
    http://support.apple.com/en_US/manuals/#iwork
    You will be able to select the language used.
    I don't know if there are guides specific to the ipad versions.
    Yvan KOENIG (VALLAURIS, France) samedi 15 mai 2010 16:39:57

  • Sum, total, or count true false data vs using the insert summary

    Please, does someone have specific knowledge on how to count total instances of true or false data vs using the insert summary?
    We have data such as:
         Name          Formula1        Formula2
    Detail level     Bob Barker          True          False
    Detail level     Bob Barker          False          True
    Detail level     Bob Barker          True          False
    Detail level     Bob Barker          True          False
    Group level                    (value)          (value)
    Detail level     Drew Carey          True          True
    Detail level     Drew Carey          False          True     
    Detail level     Drew Carey          False          False
    Group level                    (value)          (value)
    I would like to group by person and run a total in the group level but count only the true data, not every instance.  The insert summary wants to sum all instances formula1 or formula2 whether they are true or false, so Bob Barker will have a value of 4 for formula1 and a value of 4 for formula2 if the insert summary is used.  Our goal is to show Bob having a value of 3 for formula1 and a value of 1 for formula2, only counting the true instances.
    I was unsucessful using the insert summary, running totals, and my  if, then, else formula statements. 
    Any ideas or suggestions?

    Instead of using true/false (which is actually returning a 1 or a 0), try using a formula like this...
    IF {TableName.FieldName} = true condition THEN 1
    Notice there is no ELSE condition, which means that if the formula evaluates to false the result will be a null value. Null values are not included in counts.
    HTH,
    Jason

  • Using lots of data in the background, without counting on the data counter

    I am having a pretty big problem with my phone where it is regularly using 171kb of data without me doing anything with the phone at all, even when I'm connected to WiFi. Last night it used 13MB without me even doing a single thing and that has been going on since I got the phone. And then, to make things worse, it doesn't record any of this data usage on the internal counter. I spoke to a CS person at Rogers who said she had never seen anything like it before and transferred me to technical support. That guy, who was about as useful as a hole in the head basically said nothing was wrong.
    So here I have an iPhone that is eating up all of my data allowance, running itself towards an inevitable overage charge.
    Any ideas?

    Yeah no, I don't have push on. When I found out about this problem, I promptly turned not only push off, but I also disabled my email accounts and synced calendars.
    Today I turned my phone off for about 5 hours and confirmed with Rogers that no data was transmitted during the time it was off. I also restored the phone.
    Luckily, a really nice guy at Rogers customer service (I recall saying something about their customer service guys being great but the technical support people being useless, he proved it) gave me 1 month of unlimited data usage (which I was supposed to have in the first place) in order to try and troubleshoot the problem myself. So luckily the panic is over for now and I can relax and watch X-Files for a while.
    Despite all of this, my phone is still using 171kb at random. I have determined that it is likely related to the phone (an errant app perhaps?) and that the first data charge was put through only hours after I got the phone, so it's been consisted from the beginning (which if it were an app, would limit it to only a couple: Globe and Mail, Shazam, Remote, NY Times, & Facebook were the first ones I downloaded).
    I have found many other people who are having this exact same problem (here: http://www.howardforums.com/showthread.php?t=1501910&page=1&pp=15) , but nobody who has fixed it!

  • Sum function Returning Count

    Post Author: RobCote
    CA Forum: Formula
    Any ideas why the Sum/Ag/Max functions would be returning the count of a row that has a decimal in the Field I'm trying to sum?

    Post Author: V361
    CA Forum: Formula
    does cr think the field is text ?,  if so, you may need to use a formula to convert to a number, and then sum off the formula.

  • Facebook Like Icon without count or text beside it?

    How can I get the Facebook Like button without all the text or count beside it to put on my website?

    Best to ask the source:
    https://developers.facebook.com/
    When you make the Facebook buttons there are tons of options that you can set.  It may be possible that FB doesn't allow it but I assume in the code there should be an option to turn it off through some random variable.

  • Encoder position WITHOUT counter input

    Question:
    I have three incremental encoders connected to my M-Series DAQ board (PCI-6229) that has TWO Counter input channels.  I am measuring the position of each encoder.  How do I measure the position of the third encoder if I have used-up both counter inputs?  Is there a manual way to accomplish this using my older version of Labview (version 7 express)?  Any help is appreciated.
    -Clarkam1 

    clarkam1 wrote:
    Ben,
    I'm on an extremely small budget and can only use the items available to me at present time.  That being said, is there no way to use one counter for multiple encoders?  Or could an external device be used to count which the DAQ board would read?  I appreciate your timely responses.  I'm trying to explore all other options.
    So do you work for free?
    If you are determined to get all three counters going with that device, you have a big challenge ahead of you. I'll try to explain. At teh input of your counters you have signal conditioning that feeds the counter itself. To do the same thing using analog input channels (since all of the counters are already used) you will have to develop code that simulates the signal conditioning, converts the analog to digital (this may sound easy but if you need to implement over-sampling its not) and then do the work of the counter, again in software.
    If my customer was forcing this on me I would first review the behavour of the hardware and use it to establish the requirements of my code. So if you do not have an EE background, you will first have to learn the hardware so you can write software that does the same thing.
    So if you work for free then you may want to chase down the examples that NI ships for their FPGA targets that implement serial protocols and the like. You may be able to harvest some code and examples from there. If you don't work for free, then you really have to decide if you want to re-invent in software what you can purchase.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Minimum value without counting those with 0 values: help!

    Hi Experts,
    I need your help.  I want to list only the minimum value for kf A but not counting 0 values.  The minimum value is based on order #.  For example, I want to see the minimum order amount(kf A) for this week, not counting 0.  I can't use conditions because it would just remove that particular row from the result.  For example, if I put a condition that kf A > 0.  Then the result would yield nothing.  This is aggregate data for 1 week period.  I only need a summarize report stating that for week x, I have the lowest order of $$$(not zero), and listing all doc # on the report is not an option.  I also tried, multiply (kf A ==0)*99999, through formula kf, and that didn't work either.
       I haven't tried virtual key figure or adding another kf to cube - those are options that I afraid to tackle right now.
    Any help is appreciated,
    Thanks.

    Hi,
    Try to use Exception aggregation to aggregate based on order #.
    In the condion you put key figure value > 0.
    Regards,
    Vivek

  • Method to count characters without counting spaces

    I need help writing a method in the below code that will return the total number of characters in the full name without including spaces. I'm not sure if I should use a variable.length() or how to go about this.
    public class Name {
         private String firstName;
         private String middleName;
         private String lastName;
         private String initials;
         private String fullName;
         // Constructor -- initializes variables
         public Name (String first, String middle, String last, String threeInitials)
              firstName = first;
              middleName = middle;
              lastName = last;
              initials = threeInitials;
         // Method to return the first name
         public String getFirst()
              return firstName;
         // Method to return the middle name
         public String getMiddle()
              return middleName;
         // Method to return the last name
         public String getLast()
              return lastName;
         public String getFullName()
              return (firstName + " " + middleName + " " + lastName);
         // Method to return a string last name,
         public String getLastFirstMiddle()
              return (lastName + "," + firstName + " " + middleName);
         // Method to compair if first names are the same
         public boolean equals(Name otherName)
              return ( otherName.getFirst().equalsIgnoreCase(this.firstName) );
         // Method to return three first initials of the name
         public String getInitials ()
              //firstName.substring(0);
              //middleName.substring(0);
              //lastName.substring(0);
              return (firstName.substring(0) + " " +
              middleName.substring(0) + " " +
              lastName.substring(0));
         // Method to return total number of character in full name not including spaces
         public String getLength()
              return ();
    }//end class

    I suppose you could use the following...
    int finalLength = name.replaceAll("\\s", "").length();
    On the other hand since it appears you are adding the spaces in in the first place, why not just not add them in the first place?

  • Getting Sum, Count and Distinct Count of a file

    Hi all this is a UNIX question.
    I have a large flat file with millions of records.
    col1|col2|col3
    1|a|b
    2|c|d
    3|e|f
    3|g|h
    footer****
    I am supposed to calculate the sum of col1 =9, count of col1 =4, and distinct count of col1 =c3
    I would like it if you avoid external commands like AWK. Also, can we do the same by creating a function?
    Please bear in mind that the file is huge
    Thanks in advance

    This sounds like homework for a shell class, but here goes. Save into a file, maybe "doit". Run it like this:
    $ ./doit < data
    <snip>
    #!/bin/sh
    got0=0
    got1=0
    got2=0
    got3=0
    got4=0
    got5=0
    got6=0
    got7=0
    got8=0
    got9=0
    sum=0
    cnt=0
    IFS='|'
    while read c1 c2 c3 junk; do
    # Sum and count
    echo "c1=${c1}"
    case "${c1}" in
    [0-9] )
         sum=$(expr ${sum} + ${c1})
         cnt=$(expr ${cnt} + 1)
    esac
    # Distinct
    case "${c1}" in
    0 )     got0=1;;
    1 )     got1=1;;
    2 )     got2=1;;
    3 )     got3=1;;
    4 )     got4=1;;
    5 )     got5=1;;
    6 )     got6=1;;
    7 )     got7=1;;
    8 )     got8=1;;
    9 )     got9=1;;
    esac
    done
    echo "cnt=${cnt}"
    echo "sum=${sum}"
    echo "distinct="$(expr $got0 + $got1 + $got2 + $got3 + $got4 + $got5 + $got6 + $got7 + $got8 + $got9)
    <snip>

  • SSRS report with tabular model – MDX query how to get the sum and count of measure and dimension respectively.

    Hello everyone,
    I am using the following MDX query on one of my SSRS report.
    SELECT NON EMPTY { [Measures].[Days Outstanding], [Measures].[Amt] } ON COLUMNS,
    NON EMPTY { ([Customer].[Customer].[Customer Key].ALLMEMBERS) }
    HAVING [Measures].[ Days Outstanding] > 60
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM ( SELECT ( STRTOSET(@Location, CONSTRAINED)) ON COLUMNS
    FROM ( SELECT ( {[Date].[Fiscal Period].&[2014-06]}) ON COLUMNS
    FROM [Model]))
    Over here, the data is being filtered always for current month and for a location that is being selected by user from a report selection parameter.
    I would like to get the count of total no. of customers and sum of the amount measure.
    When I am using them in calculated members it gives incorrect values. It considers all records (ignores the sub-select statements) instead of only the records of current month and selected location.
    I also tried with EXISTING keyword in calculated members but there is not difference in output. Finally, I manage the same at SSRS level.
    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Any help would be much appreciated.
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Hi Ankit,
    We can use SUM function and COUNT function to sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension. Here is a sample query for you reference.
    WITH MEMBER [measures].[SumValue] AS
    SUM([Customer].[Customer].ALLMEMBERS,[Measures].[Internet Sales Amount])
    MEMBER [measures].[CountValue] AS
    COUNT([Customer].[Customer].ALLMEMBERS)
    MEMBER [Measures].[DimensionName] AS [Customer].NAME
    SELECT {[Measures].[DimensionName],[measures].[SumValue],[measures].[CountValue]} ON 0
    FROM [Adventure Works]
    Besides, you ask that does it make any difference if I manage it as SSRS level and not at MDX query level. I don't thinks it will make much difference. The total time to generate a reporting server report (RDL) can be divided into 3 elements:Time to retrieve
    the data (TimeDataRetrieval);Time to process the report (TimeProcessing);Time to render the report (TimeRendering). If you manage it on MDX query level, then the TimeDataRetrieval might a little longer. If you manage it on report level, then the TimeProcessing
    or TimeRendering time might a little longer. You can test it on you report with following query: 
    SELECT Itempath, TimeStart,TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering, ByteCount, [RowCount],Source
    FROM ExecutionLog3
    WHERE itempath like '%reportname'
    Regards,
    Charlie Liao
    TechNet Community Support

  • Select count of sum

    Hi
    Need help with getting a count of different sums:
    Table: Stay
    Columns: Name, Nights
    each name can have multiple rows with different number of nights, now I have a select looking like this:
    select sum(nights),name from stay
    group by name
    The result could look something like this:
    1 smith
    2 miller
    1 grant
    1 simpson
    2 sharp
    How do I do to get a count on the sum(night)? Is it possible in the same query?

    If you want to count how many distinct records appear in your current select statement (i.e. 5 in this case), you can do
    SELECT count(*) num_distinct_guests,
           total_nights,
           name
    FROM (
      SELECT sum(nights) total_nights,
             name
        FROM stay
      GROUP BY name
    )If you want the total number of stays, in addition to the total time stayed, use something like
    SELECT sum(nights),
           name,
           count(nights)
      FROM stay
      GROUP BY name;Justin

  • Sum Distinct Count

    Is there a way to sum a distinct count?
    I have a distinct count placed on GF2 and need the Sum of the Distinct count of GF1.
    Is this possible?
    Thanks for any help and suggestions,
    Jen

    Hi Jen,
    Try this:
    1) Create a formula on the Group Footer 2:
    WhilePringtingRecords;
    Numbervar dc;
    dc := dc + distinctcount({database field}, {group});
    2) Create another formula to display the sum and place this on the GF1:
    WhilePringtingRecords;
    Numbervar dc;
    3) Create a reset formula and place it on the GH1:
    WhilePringtingRecords;
    Numbervar dc := 0;
    -Abhilash

Maybe you are looking for

  • Why am I having so many issues, should have stayed...

    Hi all, I had infinity installed last month with a promised 55/20 upload download, the first installation guy came fitted it and left and my speeds were awful, a week later another engineer came from BT and re did all the previous engineers work, aft

  • Com.evermind.server.http.HttpIOException: There is no process to read data

    Hi, In one of our web application deployed in OC4J( Oracle9ias 9.0.2.3) containers we are getting "com.evermind.server.http.HttpIOException: There is no process to read data written to a pipe." Exception. The Stack Trace: com.evermind.server.http.Htt

  • Send a mail from forms10g

    Respected guru's, Can u plez guid me how how i send a mail from forms 10g?? Edited by: user651567 on Mar 7, 2009 10:27 AM

  • Performance: many queries used in dashboard

    Hi experts, My dashboard contains more than 30 queries runing on 2 multiproviders. When looking in sm50 it seems as though only 2 queries are run in parallel after pressing the submit button. Moreover the queries that should provide results on the fi

  • Just got a mini.  already have a 20g.

    I'm having trouble installing the mini ipod software in my computer. I already have the 20g software installed, is that why? At the step where it asks to plug in the ipod mini to configure, the installation stops. I tried to tranfer music in the mini