Search Results

Search found 8344 results on 334 pages for 'count'.

Page 10/334 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Distinct Count of Customers in a SCD Type 2 in #DAX

    - by Marco Russo (SQLBI)
    If you have a Slowly Changing Dimension (SCD) Type 2 for your customer and you want to calculate the number of distinct customers that bought a product, you cannot use the simple formula: Customers := DISTINCTCOUNT( FactTable[Customer Id] ) ) because it would return the number of distinct versions of customers. What you really want to do is to calculate the number of distinct application keys of the customers, that could be a lower number than the number you’ve got with the previous formula. Assuming that a Customer Code column in the Customers dimension contains the application key, you should use the following DAX formula: Customers := COUNTROWS( SUMMARIZE( FactTable, Customers[Customer Code] ) ) Be careful: only the version above is really fast, because it is solved by xVelocity (formerly known as VertiPaq) engine. Other formulas involving nested calculations might be more complex and move computation to the formula engine, resulting in slower query. This is absolutely an interesting pattern and I have to say it’s a killer feature. Try to do the same in Multidimensional…

    Read the article

  • Analysing Indexes - count *

    - by GrumpyOldDBA
    In my presentations on indexing I have always said that you should explore the advantages of covering your clustered index with a secondary index. In circumstances where you might want to just return values form the PK ( assuming it's your clustered index ) a secondary index will be more efficient especially when the row size is wide. Any operation on a clustered index will always return the entire row, so select ID from dbo.mytable where ID is the clustered PK integer will return not just the...(read more)

    Read the article

  • Download Count Problems

    Something is apparently wrong in the Android Market. We are getting multiple reports of erroneous download counts. The right people are aware of the situation and are working...

    Read the article

  • OpenGL - Rendering from part of an index and vertex array depending on an element count

    - by user1423893
    I'm currently drawing my shapes as lines by using a VAO and then assigning the dynamic vertices and indices each frame. // Bind VAO glBindVertexArray(m_vao); // Update the vertex buffer with the new data (Copy data into the vertex buffer object) glBufferData(GL_ARRAY_BUFFER, numVertices * sizeof(VertexPosition), m_vertices.data(), GL_DYNAMIC_DRAW); // Update the index buffer with the new data (Copy data into the index buffer object) glBufferData(GL_ELEMENT_ARRAY_BUFFER, numIndices * sizeof(unsigned short), indices.data(), GL_DYNAMIC_DRAW); glDrawElements(GL_LINES, numIndices, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0)); // Unbind VAO glBindVertexArray(0); What I would like to do is draw the lines using only part of the data stored in the index and vertex buffer objects. The vertex buffer has its vertices set from an array of defined maximum size: std::array<VertexPosition, maxVertices> m_vertices; The index buffer has its elements set from an array of defined maximum size: std::array<unsigned short, maxIndices> indices = { 0 }; A running total is kept of the number of vertices and indices needed for each draw call numVertices numIndices Can I not specify that the buffer data contain the entire array and only read from part of it when drawing? For example using the vertex buffer object glBufferData(GL_ARRAY_BUFFER, numVertices * sizeof(VertexPosition), m_vertices.data(), GL_DYNAMIC_DRAW); m_vertices.data() = Entire array is stored numVertices * sizeof(VertexPosition) = Amount of data to read from the entire array Is this not the correct way to approach this? I do not wish to use std::vector if possible.

    Read the article

  • Thread count in Java game

    - by Taylor Hill
    I'm just curious as to what a reasonable number of threads is for a simple 2D mmo in Java. Is it reasonable to have two threads per connection, one for the input stream and one for the output stream? The reason I ask is because I use a blocking method on the input stream, and a workaround seems unnecessarily complex if I were to try to get around it without adding threads. This is mostly for my own edification; I don't expect to have 5 million people playing it ever, or even 5, but I'm wondering what a good scalable solution is, and if this is reasonable for a small server (<30 connections).

    Read the article

  • One Way Link Building Service Tips You Can Count On

    Links, be it one way or reciprocal, is an essential component in Search Engine Optimization (SEO); and it plays an important role in improving search engine rankings too. To meet this incessant demand for links, link building services have now come up, which prove to be an invaluable tool to website owners.

    Read the article

  • The need to reduce mesh count

    - by OJW
    In Panda3d, I load a model and place 10000 references to it in the scene-graph. It runs at (say) 2Hz. I load a 3d model containing 10000 copies of that exact same object, and it runs at (say) 60Hz. As does using the flattenStrong() command which is effectively the same thing but at runtime. So the question is: is this behaviour a peculiarity of Panda3d, or is it a fundamental law which applies to all games engines?

    Read the article

  • Get One Way Links - Tips You Can Count On

    One of the primary objectives of most websites is to increase its search engine rankings. One sure-fire way of doing this is to get one way links to the website in concern. There are many strategies that can be adopted with this end in mind, a few of which are mentioned below.

    Read the article

  • Add Comment and Reaction Count in Wordpress with Disqus plugin

    - by FS
    Okay I'm trying to add comments and reactions count just like what you would normally see on some wordpress blogs like http://johntwang.com/blog/ where on the left top of each post there is ** comment and * reactions* My problem is I can't find the disqus's documentation, where hopefully there is some method I can call to return me the number of reactions and comments. Also if I use the wordpress default method <?php comments_popup_link ('zero','one','more','CSSclass','none');?> it only displays "Comments" not even the comment's number count on the main page. How can I add reaction and comment count with disqus plugin ? edit: well my site is http://www.windows7hacker.com/ I don't know how I suppose to add comments count at first place. But right now if I use the wordpress method, it will return me only comments, which is exactlly one of the problem they have described in their help page I've tired to check the comment count option still doesn't work :(

    Read the article

  • self join- how to use the aggregate functions

    - by Ranjana
    self join- how to use the aggregate functions select a.tablename, b.TableName,b.UserName from Employee a inner join Employee b on a.ColumnValue=b.ColumnValue and and a.TableName <> b.TableName and a.UserName=b.UserName and also to check whether the same user has count of records i.e Employee a = count of records of Employee b. how to add count function over here

    Read the article

  • How to use sum and count functions

    - by Odette
    hi guys I am trying to get the total count and total sum per salesperson but its not working in my WITH query Currently I have: WITH CALC1 AS (SELECT B.OTSMAN AS SALESMAN, COUNT(B.ONINUM) AS COUNT, SUM(B.OVSVAL) AS SVAL FROM @[email protected] AS B WHERE B.OCSGRP <> 'INT' AND B.OCSGRP <> 'INX' AND B.OCPSBR IN (@OCPSBR@) AND B.ICMATX <> '705' AND B.OCSGRP NOT LIKE 'S/%' GROUP BY B.OTSMAN, B.ONINUM ORDER BY B.OTSMAN ASC) SELECT SALESMAN, COUNT, SVAL FROM CALC1 ORDER BY SALESMAN THE RESULT IS: AM 1 79.03 AM 40 1337.70 AM 48 4627.15 AM 42 2727.40 AM 1 111.79 AM 1 1110.00 AM 52 3018.77 How do i change my query so I only get one record with the total count and value per salesperson? AM 1 13,011.84

    Read the article

  • R counting the occurance of similar rows of data frame

    - by Matt
    I have data in the following format called DF (this is just a made up simplified sample): eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0 random 1 1 1500 1500 100 120 40 232342 2 2 1000 1250 100 120 40 11843 3 3 1250 1250 100 120 40 981340234 4 4 1000 1187.5 100 120 40 4363453 5 1 2000 2000 200 100 40 345902 6 1 3000 3000 150 90 10 943 7 1 2000 2000 90 90 100 9304358 8 2 1800 1900 90 90 100 284333 However, the eval.count column is incorrect and I need to fix it. It should report the number of rows with the same values for (green.h.0, green.v.0, and offset.0) by only looking at the previous rows. The example above uses the expected values, but assume they are incorrect. How can I add a new column (say "count") which will count all previous rows which have the same values of the specified variables? I have gotten help on a similar problem of just selecting all rows with the same values for specified columns, so I supposed I could just write a loop around that, but it seems inefficient to me.

    Read the article

  • R counting the occurrences of similar rows of data frame

    - by Matt
    I have data in the following format called DF (this is just a made up simplified sample): eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0 random 1 1 1500 1500 100 120 40 232342 2 2 1000 1250 100 120 40 11843 3 3 1250 1250 100 120 40 981340234 4 4 1000 1187.5 100 120 40 4363453 5 1 2000 2000 200 100 40 345902 6 1 3000 3000 150 90 10 943 7 1 2000 2000 90 90 100 9304358 8 2 1800 1900 90 90 100 284333 However, the eval.count column is incorrect and I need to fix it. It should report the number of rows with the same values for (green.h.0, green.v.0, and offset.0) by only looking at the previous rows. The example above uses the expected values, but assume they are incorrect. How can I add a new column (say "count") which will count all previous rows which have the same values of the specified variables? I have gotten help on a similar problem of just selecting all rows with the same values for specified columns, so I supposed I could just write a loop around that, but it seems inefficient to me.

    Read the article

  • SQL query for getting count on same table using left outer join

    - by Sasi
    Hi all, I have a table from which i need to get the count grouped on two columns. the table has two columns one datetime column and another one is success value(-1,1,0) What i am looking for is something like this... count of success value for each month month----success-----count 11------- -1 ------- 50 11------- 1 --------- 50 11------- 0 ------- 50 12------- -1 ------- 50 12------- 1 ------- 50 12------- 0 ------- 50 if there is no success value for a month then the count should be null or zero. I have tried with left outer join as well but of no use it gives the count incorrectly. Thanks in advance Sasi

    Read the article

  • counting twice in a query, once using restrictions

    - by Andrew Heath
    Given the following tables: Table1 [class] [child] math boy1 math boy2 math boy3 art boy1 Table2 [child] [glasses] boy1 yes boy2 yes boy3 no If I want to query for number of children per class, I'd do this: SELECT class, COUNT(child) FROM Table1 GROUP BY class and if I wanted to query for number of children per class wearing glasses, I'd do this: SELECT Table1.class, COUNT(table1.child) FROM Table1 LEFT JOIN Table2 ON Table1.child=Table2.child WHERE Table2.glasses='yes' GROUP BY Table1.class but what I really want to do is: SELECT class, COUNT(child), COUNT(child wearing glasses) and frankly I have no idea how to do that in only one query. help?

    Read the article

  • LINQ count query returns a 1 instead of a 0

    - by user335810
    I have the following view:- CREATE VIEW tbl_adjudicator_result_view AS SELECT a.adjudicator_id, sar.section_adjudicator_role_id, s.section_id, sdr.section_dance_role_id, d.dance_id, c.contact_id, ro.round_id, r.result_id, c.title, c.first_name, c.last_name, d.name, r.value, ro.type FROM tbl_adjudicator a INNER JOIN tbl_section_adjudicator_role sar on sar.section_adjudicator_role2adjudicator = a.adjudicator_id INNER JOIN tbl_section s on sar.section_adjudicator_role2section = s.section_id INNER JOIN tbl_section_dance_role sdr on sdr.section_dance_role2section = s.section_id INNER JOIN tbl_dance d on sdr.section_dance_role2dance = d.dance_id INNER JOIN tbl_contact c on a.adjudicator2contact = c.contact_id INNER JOIN tbl_round ro on ro.round2section = s.section_id LEFT OUTER JOIN tbl_result r on r.result2adjudicator = a.adjudicator_id AND r.result2dance = d.dance_id When I run the following query directly against the db I get 0 in the count column where there is no result select adjudicator_id, first_name, COUNT(result_id) from tbl_adjudicator_result_view arv where arv.round_id = 16 group by adjudicator_id, first_name However when I use LINQ query I always get 1 in the Count Column var query = from arv in db.AdjudicatorResultViews where arv.round_id == id group arv by new { arv.adjudicator_id, arv.first_name} into grp select new AdjudicatorResultViewGroupedByDance { AdjudicatorId = grp.Key.adjudicator_id, FirstName = grp.Key.first_name, Count = grp.Select(p => p.result_id).Distinct().Count() }; What do I need to change in the View / Linq query.

    Read the article

  • Is count(*) really expensive ?

    - by Anil Namde
    I have a page where I have 4 tabs displaying 4 different reports based off different tables. I obtain the row count of each table using a select count(*) from <table> query and display number of rows available in each table on the tabs. As a result, each page postback causes 5 count(*) queries to be executed (4 to get counts and 1 for pagination) and 1 query for getting the report content. Now my question is: are count(*) queries really expensive -- should I keep the row counts (at least those that are displayed on the tab) in the view state of page instead of querying multiple times? How expensive are COUNT(*) queries ?

    Read the article

  • counting employee attendance

    - by jjj
    i am trying to write a statment for counting the employees attendance and execute thier id , name and the days that he has working on the last 3 months by counting the duplicate id on NewTimeAttendance for month 1 , 2 and 3 .. i tried to count : Select COUNT(employeeid) from NewTimeAttendance where employeeid=1 and (month=1 or month =2 or month = 3) This is absolutely working ,but just for one employee... the secound try: SELECT COUNT(NewEmployee.EmployeeID) FROM NewEmployee INNER JOIN NewTimeAttendance ON NewEmployee.EmployeeID = NewTimeAttendance.EmployeeID and (month=1 or month =2 or month = 3) This is working , but it counts all employees .. and i want it to execute each EmployeeId, EmployeeName and number of days as new record last try: (before you see the code ... it is wrong ..but i am trying) for i in 0..27 loop SELECT COUNT(NewEmployee.EmployeeID),NewEmployee.EmployeeId,EmployeeName FROM NewEmployee INNER JOIN NewTimeAttendance ON NewEmployee.EmployeeID(i) = NewTimeAttendance.EmployeeID and (month=1 or month =2 or month = 3) end loop i realy need help...thanks in advance

    Read the article

  • Counting comma seperated values in php,how to?

    - by Jay
    Hey folks, I have a variable holding values separated by a comma (Implode), I'm trying to get the total count of the values in that variable however, count() is just returning 1. I've tried converting the comma separated values to a properly formatted array which still spits out1. So heres the quick snippet where the sarray session equals to value1,value2,value3: $schools = $_SESSION['sarray']; $result = count($schools); Any help would be appreciated.

    Read the article

  • Count number of messages per user

    - by Pr0no
    Consider the following tables: users messages ----------------- ----------------------- user_id messages msg_id user_id content ----------------- ----------------------- 1 0 1 1 foo 2 0 2 1 bar 3 0 3 1 foobar 4 3 baz 5 3 bar I want to count the number of messages per user and insert the outcome into users.messages, like this: users ----------------- user_id messages ----------------- 1 3 2 0 3 2 I could use PHP to perform this operation, pseudo: foreach ($user_id in users) { $count = select count(msg_id) from messages where user_id = $user_id update users set messages = $count } But this is probably very inefficient as compared to one query executed in MySQL directly: UPDATE users SET messages = ( SELECT COUNT(msg_id) FROM messages ) But I'm sure this is not a proper query. Therefore, any help would be appreciated :-)

    Read the article

  • Counting number of values between interval

    - by calccrypto
    Is there any efficient way in python to count the times an array of numbers is between certain intervals? the number of intervals i will be using may get quite large like: mylist = [4,4,1,18,2,15,6,14,2,16,2,17,12,3,12,4,15,5,17] some function(mylist, startpoints): # startpoints = [0,10,20] count values in range [0,9] count values in range [10-19] output = [9,10]

    Read the article

  • Java - Count words in two documents

    - by user552961
    Good Morning - it is school assignment, I am not asking for any source code (if you can provide any pesudo code it would be awesome). Here is the problem :( I have to create a term frequency table. It is not pure TF, I just need to count the words and write down. I know basic steps to do it 1 - extract all terms (I can do it with file reader) 2 - remove repeating terms (I can do it with TreeMap) The output of 2nd step would be Niga, ponga, dinga, bitlo, etc. 3 - Now I have to see if there is any word in current file from above terms or not, if yes then I will count. Now this is my problem, I stucked on step 3 :( I have some idea how to count words with TreeMap (treemap.containskey etc.) but it would be global count not local count for each file :( Any pseudo code?

    Read the article

  • simple query Delete records in a table based on count logic

    - by user1905941
    a table with a pk and status column which is having values as 'Y','N','NULL' Query: get the count of records with status column as 'Y', if this count exceeds 1% of total count of records then dont delete , else delete the records in the table. i tried like this Declare v_count Number; v_count1 Number; BEGIN v_count := select count(*) from temp; v_count1 := select count(*) from temp where status = 'Y' ; v_count := v_count + ((0.1) * (v_count)) if (v_count1 > v_count) { insert into temp1 values(pk,status) } else { Delete from temp ; } END;

    Read the article

  • Core-data: when accessing a relationship, the count method on NSSet fails

    - by lordsandwich
    I'm trying to access a relationship (one to many) programatically. My Data model contains an NSManagedEntity called language (with a two string attributes) with a relationship to an entity called WordCategory (one-to-many). I use an NSFetchRequest to get all the Language entities. that works fine. I get the valueForKey for the relationship and that works fine. I can work with its objects. However, when I try to send the message count to the NSSet that stores the WordCategory objects I get a In other words, this line works: NSLog(@"word category count %@",[[wordCategory anyObject] valueForKey:@"name"]); This one doesn't: NSLog(@"word category count %@",[wordCategory count] I get a the message: EXC_BAD_ACCESS in the debugger. Here's the rest of the code: NSManagedObjectContext *moc = [myAppDelegate managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; [request setEntity:[NSEntityDescription entityForName:@"Language" inManagedObjectContext:moc]]; NSError *error = nil; NSArray *results = [moc executeFetchRequest:request error: &error]; if (error) { [NSApp presentError:error]; return; } NSManagedObject *obj = [results objectAtIndex:0]; NSSet *wordCategory = [obj valueForKey:@"category"]; NSLog(@"word category count %@",[wordCategory count]); I'll appreciate any light than anybody can shed in this mystery. Thanks for your help!

    Read the article

  • how to implement word count bash shell

    - by codemax
    hey guys. I am trying to write my own code for the word count in bash shell. I did usual way. But i wanna use pipe's output to count the word. So for eg the 1st command is cat and i am redirecting to a file called med. Now i have to use to 'dup2' function to count the words in that file. How can i write the code for my wc? This is the code for my shell pgm : void process( char* cmd[], int arg_count ) { pid_t pid; pid = fork(); char path[81]; getcwd(path,81); strcat(path,"/"); strcat(path,cmd[0]); if(pid < 0) { cout << "Fork Failed" << endl; exit(-1); } else if( pid == 0 ) { int fd; fd =open("med", O_RDONLY); dup2(fd ,0); execvp( path, cmd ); } else { wait(NULL); } } And my wordcount is : int main(int argc, char *argv[]) { char ch; int count = 0; ifstream infile(argv[1]); while(!infile.eof()) { infile.get(ch); if(ch == ' ') { count++; } } return 0; } I dont know how to do input redirection i want my code to do this : When i just type wordcount in my shell implementation, I want it to count the words in the med file by default. Thanks in advance

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >