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
44 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
ID: 41859416
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
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…

930 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

12 Experts available now in Live!

Get 1:1 Help Now