Solved

Visual Studio 2008 - name with more than one visit. I need an expression to count a distinct name ID on a date

Posted on 2016-10-25
1
29 Views
Last Modified: 2016-10-25
I have a Visual Studio 2008 report with name, nameID (hidden), date of service, DOB and several other columns. I need to count the distinct name visits (using the name ID and date of service). Some names have more than one date of service with more than 1 transaction (names=30, datesvc=36, transactions=80).
 They are grouped by Name, NameID (hidden), DateSvc, Transaction. I thought Count(DateSvc) would work but it gives me the same amount of transactions, not visits. Any help is appreciated.

I can't put a sample of the data due to confidentiality. But here's a typed sample of it:
 Name......DateSvc......DOB......Trans......More columns
 DOB to the right can be several rows depending on the transaction
 Service Date can span one or several rows depending on the date of the transaction
 The name spans all rows for that persons transactions on the specific service date
 Name1.....1/1/16.....9/5/2008.....trans 1 for that day
 ...............1/4/16.....9/5/2008.....trans 1 for that day (same person)
 ...............1/4/16.....9/5/2008.....trans 2 for that day (same person)
 Name2.....6/9/16.....3/7/2002.....trans 1 for that day
 Name3.....6/9/16.....5/1/2000.....trans 1 for that day

 This should show 3 names, 4 visits and 5 transactions
 The 4 visits is where I'm having the problem.

When I try   =CountDistinct(Fields!DatesSvc.Value,"NameID")
I get:  The Value expression for the text box 'TextBox256' has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region or the name of a dataset.
I'm placing the expression in a separate tablix above the table. I want that information (totals) separate and if the user wants to see the details, they can click to toggle and see the info below
0
Comment
Question by:Lisa Randle
1 Comment
 

Accepted Solution

by:
Lisa Randle earned 0 total points
Comment Utility
Nevermind!!!  I found out its considered a Complex Expression.  
I used:  Total Visits: =CountDistinct(Fields!Name.Value & "-" & Fields!Date.Value)
Complex Expressions:  https://msdn.microsoft.com/en-us/library/dd220516.aspx#Anchor_2
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now