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

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

Measure - New Customer Count

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :Sql Server
I need to create a measure which counts the number of new customers for each time period. My fact table contains the customer number and its easy to create a distinct count of customers per month/week/year. I'm thinking I need to obtain the first order date for the given customer and compare if the select period is within the time frame, then include or exclude.  

View Complete Post

More Related Resource Links

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!

SSAS 2008 Measure group Distinct count

Hi all, I have a data of as number of trasactions,DD, SO, BouncedDD, CancelledDD all are in count (number) while adding these measures manullay to a measure group I have selected usage as DistinctCount for one measure and for all the remaining measures as DiscinctCount.While deploying the cube it shows error as "Fact table canot have more than one distinct count"  

Returning Customer Count of all categories in each time period



Lets say I have the following Table:

CustomerNumber | Date | MovieCategory
1 |2010-01-01|A
1 |2010-02-01|A
1 |2010-03-01|A
1 |2010-04-01|A
1 |2010-05-01|A
1 |2010-06-01|D
1 |2010-07-01|A
2 |2010-01-01|A
2 |2010-02-01|A
2 |2010-03-01|D
2 |2010-04-01|D
2 |2010-05-01|D
2 |2010-06-01|C
2 |2010-07-01|C
3 |2010-01-01|B
3 |2010-02-01|B
3 |2010-03-01|B
3 |2010-04-01|C
3 |2010-05-01|C

What I want to do is count the number of customers for each movie type in each date. Now I started with the following simple query

Select Date, MovieCategory, Count(CustomerNumber)
From AboveTable
Group By Date, MovieCategory
Order by Date, MovieCategory

which would be okay, but if no customer has a MovieCategory of say 'B' on a particular date then the results of the above query won't return a row that has

Date| B| 0     (date here could be any date).


which is really what I need. Is there a good way to

MDX, count of rows with non empty measure



I have a fact table with 8 measures that aren't always all available. I'd like to aggregate them with AVG() so I tried to create a calculated member:
where I1 is the measure (aggregated by sum) and #Indexes is a count of rows automatically created by SSAS. But obviously the #Indexes includes all rows, also the ones with empty measures.

M1   M2 ...
null   5
10    6

I have to have 10 as AVG rollup of M1 in this small table and now I'm getting 5.

how could I solve this?

How to filter customer count on the previous 3 months


Hi, I  want to see  the  total  number  of  new customers  for  the  last  3  months  and also the  total  the  total  number of  existing customers.I have created a meaure called "Customer Count" which  gives me  the  total number of  customers. How will  I use the date range in MDX  to filter these?

I  want to see  this  in MDX for  a  KPI. Can anyone  help  out?




Same measure group for count and distinct count in SSAS


Hello there,

I need to make DistinctCount aggregation of few columns in the same fact table in SSAS. For each DistinctCount it creates a new measure group. I need to put all these under same measure group. Please let me know how to go ahead.



How to create a new measure group for distinct count measure?


There is a warning info on my distinct count measure saying "break distinct count measure to a new group to improve performence...", but When I create a new measure group, I cannot choose the fact table which contains the distinct count measure field, as there is already a measure group using this fact table.

Then how could I remove this warning info?

Regards! directfriends.net

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!

CLR Inside Out: Measure Early and Often for Performance, Part 2


In the second of a two-part series, Vance Morrison delves into the meaning of performance measurements, explaining what the numbers mean to you.

Vance Morrison

MSDN Magazine May 2008

CLR Inside Out: Measure Early and Often for Performance, Part 1


In this month's column, get the inside scoop on how to build performance into your apps from the start, rather than dealing with the fallout after you deploy them.

Vance Morrison

MSDN Magazine April 2008

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

ASP.NET: Collect Customer Order Information on an Internet Site Using XML and Web Forms


XML has quickly become the new data structure standard for everything from database access to cross-platform computing. XML is typically considered to be a vehicle for data exchange, dynamic data presentation, and data storage. However, the potential of XML far surpasses those limited applications. This article examines one new use: the gathering of data across a number of forms in an ASP.NET Beta 1 framework application. The sample program is a Web app used for ordering pizza. It uses ASP and C# to gather order information and then stores it in XML. To build the application, several concepts are explained, including data collection, order persistence using cookies, grouping input forms, and formatting the data for display.

Jeff Jorczak

MSDN Magazine September 2001

Design for Easy Integration into Customer's Sites


This is my second ASP.net project, and I'm looking for suggestions or approaches rather than specifics, but here goes.

The project, once done, will provide a "portal" into a limited portion of the client's database.  All clients are using a SQL database, but various server software products are involved (MSSQL, MySQL, and others). 

My question, however, has more to do with the "look and feel" of the finished product.  We want to be able to integrate our 'portal' easily into the client's websites and have it look as seamless as possible.  Obviously, placements of logos, etc. -- but also colors, fonts, etc.

Client sites tend to be simplistic in design.  We envision the customer placing a link to our site from theirs, and our site will be running on IIS on their server.  At least that's the plan.

The goal right now would be to make as much of this "parameter driven" as possible, so that a lot of the install can be accomplished through some simple settings, isolated in one or two files such that at installation time we can tweak those settings and be up-and-running in a short period of time with a site that integrates reasonably well with the customer's. 

But I'm uncertain as to whether there is a better approach.  Obviously, we could try to redes

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!


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