.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Top count 25 best articles

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :Sql Server

Hi experts,

i have this necessity:

I want to extract the top 25 best articles from my sales cube and i have used the example below



[Classificazioni Codarticolo].[Cod Articolo].[Cod Articolo].



[Measures].[Quantita Mag]


My problem is that i want to extract this information with reference to a time dimension.

For example the top 25 articles in year 2010 etc...

Now if i explore the cube and i add the dimension time to the pivot i obtain a blank value.ù

How can i set the function top 25 to solve this problem?

View Complete Post

More Related Resource Links

Print row count on Label



I have an SP that simply performs a COUNT(*) from a table. I'm am trying to print that number in an ASP Label. It works in Query analyzer but I cant wrap my head around how to display it in a label. Any guidance much appreciated. 

Thank you. 

Count words in the ascx file



I have 163 .resx files. I want to count the words in these files, because my want to translate the sentences (my task is the localisation).

Now I'm opening each file in Ms Visual Studio and I count words manually. How can I count words in all files? And the second question: can I use a program what grab strings from .resx into an editor where I can translate them and save bacn into .resx files? Or must open the files one by one and edit the text fields manually?

Thanks for helping, unfortunately I'm not a programmer.

How to display a count of search results with keywords in a label?


Sorry for a basic post here; I am very new to VB!

I am currently building a search page, which includes a textbox and two drop-down lists, a search button, and a datagrid. If results are found and displayed, I would like a label to display:

(e.g.) "24 results found for 'blue sky clouds' "

...where the integer represents the results count, and the keywords and/or drop-down list selections are included in the string.

If no results are found I would like the label to display:

(e.g.) "No results were found that match your selection. Please try again"

I would also like the label to be invisible until a search occurs.

Thanks in advance!

Editor's Note: Rich Clients Count Too


It's the dead of winter here at the MSDN Magazine offices, and we're having a blast. Temperatures are making their daily struggle to stay above zero. The tempting aroma of chestnuts roasting on an open subway ventilation grate fills the city with a wintry mix of excitement and anticipation.

MSDN Magazine February 2003

Items count in scope "not available" in on WFE while it is correct in another WFE

Recently, we added a new WFE in the farm to do load balance. After installation, the search is not working occassionally(almost 50%). It apparently hits the new server. The error message:
Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.

I checked the Items count on view scopes. It is correct on old WFE, while it is "not available" on new WFE.
 In the Office Sharepoint Server Search Seveice seeting, I checked "Use this server for indexing content" and "use this server for serving search queries". I had ever tried to uncheck ""use this server for serving search queries". It is not working, either.

Any suggestion?

How to get character count in 'Multiple Text 'column using Calculated Column?


Hi All,

I have a multiple text box in a list

I want

  • A column which lists number of characters in multiple list column example 188, 199 etc
  • Multiple character column must not have more than 200 chars
Is this possible?

Appreciate all the help!


Count Query Execution


I have a class that being used to connect with the DB. Now I want to count how many times each web request executes the queries, but I've no idea where to store the counted value. I mean, Session wont, ViewState wont work as site also have webservices. What else I can use ?

count the num of rows in dataset



Anyone can tell me which part when wrong if my code is wrong ?

I'm using VS2010 have a dataset. Here is my code.

Dim temp_sec As Data.DataSet

temp_sec = ac.getTempTime("741", "10 July 2010")

suppose to have 13 rows yet i got my msgbox is 0 rows Undecided

count by casetypes with some logic

I have this query which displays all the SpecimenTypeNames for all our cases for a ComponentID. SELECT APVX.DOS.SpecimenType.SpecimenTypeName      FROM         APVX.ORDERS.ComponentOrder INNER JOIN                       APVX.ORDERS.ApCase INNER JOIN                       APVX.ORDERS.TestOrder ON APVX.ORDERS.ApCase.CaseID = APVX.ORDERS.TestOrder.CaseID INNER JOIN                       APVX.ORDERS.TestOrderSpecimen ON APVX.ORDERS.TestOrder.TestOrderID = APVX.ORDERS.TestOrderSpecimen.TestOrderID INNER JOIN                       APVX.ORDERS.Specimen ON APVX.ORDERS.TestOrderSpecimen.SpecimenID = APVX.ORDERS.Specimen.SpecimenID ON                       APVX.ORDERS.ComponentOrder.TestOrderID = APVX.ORDERS.TestOrder.TestOrderID INNER JOIN            &

MDX to get a count on a hierarchy

Hi I want to get the number of customers that placed orders for items from more than 2 Product Category in a month in the Adventure Works 2008 DW database. Can someone help me with the MDX expression? thanks


We have the following query:   SELECT H.VEHICLE_ID,                 COUNT(ISNULL(H.HISTORY_ID, 0))            FROM VEHICLES V LEFT OUTER JOIN VEHICLE_HISTORY H              ON V.VEHICLE_ID = H.VEHICLE_ID           WHERE H.SPEED >= 65             AND CONVERT(DATE, H.GPS_TIME) = CONVERT(DATE, DATEADD(DAY, -1, GETDATE()))        GROUP BY H.VEHICLE_ID;   Unfortunately, if there inst a record for a vehicle for the current day in VEHICLE_HISTORY, or there inst a record over 65 in VEHICLE_HISTORY, the query simply does not include the result. How can we include all results (i.e. return 0)? What we want is the number of rows returned to match the number of rows in the vehicles table. I thought doing the LEFT OUTER JOIN would take care of this, and return a result for all vehicles.   Thanks.

Function count through Regular Expression

Hi, I have a table with varchar(max) column. This column stores all the function calls to application. Example 1    SUM(SALARY); AVG(LEAVES)/COUNT(DAYS); 2    SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES); The above output shows the requests of User 1 and 2. User 1 called SUM, AVG and COUNT functions once. User 2 called SUM once and AVG, Count twice. I need to calculate these counts through Regular expression in SQL Server 2005. Following is script for table and data generation: CREATE TABLE [dbo].[UserRequests] (  [UserID] [int] NOT NULL,  [Requests] [varchar](255) NULL ) ON [PRIMARY] insert into [dbo].[UserRequests] values (1, 'SUM(SALARY); AVG(LEAVES)/COUNT(DAYS);') insert into [dbo].[UserRequests] values (2, 'SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES);') Any suggestion or idea would be highly admired. PS: if someone has another optimized solution for this problem, kindly suggest that as well. Regards.

Page View Count And Users Online

Hello forum I have a couple of questions.  How do I go about tracking the number page views for my web page in a sql table?  Secondly, how do I track the number of users currently online? Any help will be greatly appreciated. Thanks  

C# .NET SqlBulkCopy inserted row count

Im using a Script task to extract data from Oracle into SQL Server using SqlBulkCopy. I need to get a count of rows inserted by the SqlBulkCopy and cant figure out how to do this. I did try the SqlRowsCopied event, but it looks like I need to fill the NotifyAfter property to get the SqlRowsCopied to fire. I am confused because if I have say 11 rows in the source, and set the NotifyAfter to 100 it doesnt fire. If I set the NotifyAfter property to 10, then the event fires and I get the count of 10 and not 11 (however, 11 rows get inserted). Is there an efficient way to get the RowsCopied for the SqlBulkCopy?  ThanksYou are so wise...like a miniature budha covered in fur. -Anchorman

How can I GROUPBY Branch, then by Client and then by Referral Type and COUNT DISTINCT LPS # in JavaS

Hi, I have an array in JavaScript. How can I GROUPBY Branch, then by Client and then by Referral Type and COUNT DISTINCT LPS # in JavaScript. Please note I need to do this client side using JavaScript. Array Data: Branch Client    Referral Type LPS # 402036   402430    Psychological File Review 30 402049   402805    In-Home Assessment 10.87927 402050      402993   Chiropractic Assessment 100 402049 402805   Chiropractic File Review 10.88054 402049 402806   Chiropractic File Review 10.88055 402049 402806   Defense Medical 20 402049 402807   Chiropractic Assessment 10 402049 402807   In-Home Assessment + Form 1 10.88054 402049 402807   Physiotherapy Assessment 10 402049 402808   Attendant Care Assessment 10 402049 402808   Chiropractic Assessment 10.88041 402049 402808   In-Home Assessment 10 402049 402816   Chiropractic Assessment 10.85316 402049 402827   Neurological File Review 10.88047 402049 402827   Social Work File Review 10.88044 402050 402605   Psychological File Review 880434 402050 402661   Physician Assessment 878203 402050 402993   Physician A

Count of fact rows not being displayed correctly

I have the most generic measure - count of rows from the fact table. When I query the underlying fact table, example...select count(Primary_key) , I get accurate results. Also, I see my partition has exact same count for the rows. But, when I process the cube and view the same measure in the browser it shows less than the actual count . I never had this problem before. What could I be missing? I would appreciate your suggestions.   Rok

Optimize Calculated Measure containing COUNT EXISTING

Hi, My goal is to change the text color of all cells that contain aggregated values. Currently I achieve it like this: I COUNT the members of all attributes of all dimensions. To be multi-select-safe I am using the EXISTING keyword. If the members count of at least one dimension is not 1 than the background color of the cell is changed. CREATE MEMBER CURRENTCUBE .[Measures].[SingleCellSelected]   AS iif ((COUNT (Existing ([Dim1].[Attr1].[ Attr1].MEMBERS ))=1) AND (COUNT (Existing ([Dim1].[Attr2].[Attr2].MEMBERS ))=1) AND (COUNT (Existing ([Dim2].[Attr3].[Attr3].MEMBERS ))=1) AND (COUNT (Existing ([Dim2].[Attr4].[Attr4].MEMBERS ))=1) AND (COUNT (Existing ([Dim3].[Attr5].[Attr5].MEMBERS ))=1),1,0),   VISIBLE = 0  ;    SCOPE ([Measures].AllMembers ); FORE_COLOR (this ) = iif ([Measures].[SingleCellSelected]=1,0,16744448); END SCOPE ; This approach works but it performs badly with attributes with many members. Do you have any idea how to optimize this? Thank you!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend