.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

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

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
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

View Complete Post

More Related Resource Links

Determining client type (Word/SharePoint UI)

Hi, When a user edits a document using word or SharePoint UI, I need to determine type of a client: Word or SharePoint UI. In my event handler, I need to take a specific action if he is updating a document using Word. The specific action to take is to email the user if his update violates our business rules. Currently we are not able to display the error message if he is using Word (see related thread: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/b322dc52-0158-40ef-90f0-dc6cac13fc10) Is there a way to do this? I could not find any member of SPItemEventProperties class which gives me a clue about it. There is a Context member I could not use anyway.

How to expose an enum type to a client via WCF if it isn't used as a param type in any service oper

Hi,   I want to 'expose' an enum type from my server via WCF so that my client can access it. This happens automagically if I use the enum as a parameter type within a service operation, however, what if the particular enum isn't part of any service operation?   In other words, I've defined serveral enums within my Server that are quite useful to my client (even though they don't appear in any of my paramter declarations for the service operations).   The only way I can get this to work is simply create dummy service operations that contains these enum's as arguments. The MEX page then exposes these types for my client to use, but this seems a bit naff.   Thanks   Paul.

[LINQ2SQL] Groupby + count

I have 2 SQLSERVER tables -QUESTIONS-ANSWERSI need all the questions and the ANSWERS countI'm try to convert this SQL query in LinqSELECT Q.*,A.NumberofA FROM Questions Q LEFT OUTER JOIN (   SELECT    Answers.QuestID,    count(Answers.ID) as NumberofA   FROM Answers   group by Answers.QuestID   ) AS A On Q.ID = A.QuestIDI have tryvar Query = from q in this.Questions                    select new { q,   q.Answers.Count()}But the result is a not performant query.

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"  

How to get input parameter's count and type by using MetadataImporter

I want to get each input parameter type of all operations in WCF Service via MetadataImporter, the code as below: Service Contract: it is default after you created a wcf applicaiton in vs 2010     [ServiceContract]     public interface IService1     {         [OperationContract]         string GetData(int value);         [OperationContract]         CompositeType GetDataUsingDataContract(CompositeType composite);         // TODO: Add your service operations here     }   Client Side:             string mexAddress = http://localhost:53720/Service1.svc?wsdl;                      BasicHttpBinding binding = new BasicHttpBinding();             MetadataExchangeClient MEXClient = new MetadataExchangeClient(binding);             MetadataSet metadata = MEXClient.GetMetadata(new Uri(mexAddress),  MetadataExchangeClientMode.HttpGet);          &nb

Form opening in infopath client despite Content Type settings "Display as a Web Page"

Hi all,   I have a strange behavior with my forms. The infopath template is defined as Content Type for my Form library, in the advanced settings I have checked "Display as a Web page" for the "Opening browser-enabled documents" setting. Despite that when the client is availble on the computer which is browsing the Form Library, I'm asked to "Open", "Save" or "Cancel" instead of opening the form in the browser.   Any idea why this is happening ?

How to insert SQL2008 date data type using ADODB.Recordset and Native Client?



I am working with a classic ASP application that we are trying to keep hobbling along while it gets rewritten.  The underlying database has been upgraded many times and is currently running on SQL Server 2008.

Recently a column of table was updated from a smalldatetime (with a check constraint to ensure it didn't have any time values) to simply the date type, but the code now does not work.  I was originally using SQLOLEDB, and was confident that treating the date as a string would be find with our client.  Unfortunately it does not, nor does it work using the SQLNCLI10 client.

This is the stripped down code:

Set adoConnection = aspServer.CreateObject("ADODB.Connection")
adoConnection.Open "Provider=SQLNCLI10"  ' Details Removed
Set adoRS = aspServer.CreateObject("ADODB.Recordset")
adoRS.CursorLocation = adUseClient
adoRS.Open "SELECT * FROM TestTable WHERE id = 0", adoConnection, adOpenKeyset, adLockOptimistic, adCmdText
adoRS("datecolumn") = "09/20/2010"

On the update line, I get the following error:

Microsoft SQL Server Native Client 10.0 error '80040e07'
Error convertin

Expose data contract used in two services as a single type on client side?


I have a .dll that contains my data contracts and I reference this dll in two different services.

Now, on the client side I don't want to add this dll because I need both WPF-clients and Silverlight clients. So, what I want is to be able to use a single data contract on the client side and not with different namespaces for the different services. As I understand this should be possible but I don't know how.

Can someone explain how I can generate a single data contract on client side that can be used for calls to both services?

Thanks for help!

MDX count distinct calculation where another column


Hi All,

i have a fact table like the following


1-episodeKey (not unique)

2-Readmission (takes value null or 'readmission' may i chaneg to (0 or 1) if that help solve the problem)


4-other dimesnions foreign keys


i want to count distinct episode keys where readmission is not null,

so how can i write a calculation that make that count ?




Ahmed Salah

How to count characters in a string, by type


Say I have a string in a text box like


I wish to count the number of pipes or '|'.

How can I do this with js ???

How to implement distinct count with AND/OR clause?



I'm trying to implement distinct count in MDX together with OR clause.
For instance:

I have two "questions" that I want answered via MDX.

1) Number of customers that are individuals and have at least 1 transaction

2) Number of customers that are from Serbia and have at least one arrangement

mdx 1:

with Member segmentCount as
			[Customer].[Customer].Children,[Measures].[TransactionCount] > 0)
Select segmentCount on columns FROM [CPM] 
WHERE ([Customer].[IsIndividual].[IsIndividual].&[1])
result: 35572

 mdx 2:

with Member segmentCount as
			[Customer].[Customer].Children,[Measures].[ArrangementCount] > 0))
Select segmentCount on columns FROM [CPM] 

Distinct Count - MDX



I have requirement to count of number of new products which are been sold in current quarter with respect to previous quarter.

For ex: if i have sold 10 unique products in 2010Q1 and in 2010Q2 14 product are been sold in which 4 product are newly introduced...so i want the end result count to be 4.



Dedecting Client Input Type Data


HI all,

I have a huge form control in my asp.net application and i need to pass all value to SQL procedure.

I am looking some ready function which can  check each input data if it have the below format.


accordingly i can format the string and send to the procedure.

It is in VB language.

Thank You

resolving type information of webmethod object parameters from non .NET client call



I have a asmx web service that has exposed my Product and Order object.

I've a non .NET client that builds their own Product and Order classes using SOAP libraries.

Now, in my web serivce, i've a web method SaveEntity(object[] entities) where the entities array holds Product or Order or both objects it receives from non .NET client. 

Now, I need to extract the type information for each of the entities inside the object[] array. The first choice is object.GetType(). But my question is: is it guaranteed that object.GetType would return the exact type information (Product or Order for this instance)? 

Thanks in advance

AGGREGATE over a time period: how to behave like a distinct count ? (aggregate on the full period an


I would like to compute a measure "MyMeasure" over the last 12 months :

Aggregate({[Event DATE].[Calendar].CurrentMember.Lag(11):[Event DATE].[Calendar].CurrentMember},[Measures].[MyMeasure])

MyMeasure is not a distinct count, so the results returned is the SUM of the distinct count performed on each month over the last 12 month.

What I would like to have is the distinct count over a full year (all months taken together).

For example, suppose that MyMeasure is a simple measure that always returns 1.

The aggregation returns 12 (1 for each month then SUM). I would like it to return 1 (measure on the whole period).

Can somebody help me that's really a very big issue I have to fix !


calculated member-distinct count


I have a product dimension table whose level is category-brand-product id. I have a fact table at lowest level product id and measure sales amt which can have positive and negative values.

I need distinct count  of brands for a particular category whose sales is greater than 0.

fact table data:                                   product table
productid salesamt                              category brand   productid
1             50                                          c1         b1         1
2             100                &nb

Distinct Count with Filtering IDs



Please bear with me as I am newbie in SSAS/MDX. I want DISTINCTCOUNT on ID column of my fact table but after filtering out -1 i.e. unknown IDs.
Here are my tables

ID  Name
-1  Unknown
1   Joe
2   Tim
3   Paul
4   Zina

ID Name
-1    Not Registered
11   Maths
22   Science
33   Arts

DimStudentID  DimCourseID  Marks
1                    11                   89
1                    22                   87
1                    33       &n

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